gopher

package gopher

Type members

Classlikes

trait Channel[F[_], W, R] extends WriteChannel[F, W] with ReadChannel[F, R] with Closeable
Companion
object
Source
Channel.scala
object Channel
Companion
class
Source
Channel.scala
class ChannelClosedException(debugInfo: String) extends RuntimeException
class ChannelWithExpiration[F[_], W, R](internal: Channel[F, W, R], ttl: FiniteDuration, throwTimeouts: Boolean) extends WriteChannelWithExpiration[F, W] with Channel[F, W, R]
class DuppedInput[F[_], A](origin: ReadChannel[F, A], bufSize: Int)(using api: Gopher[F])
trait Gopher[F[_]]

core of Gopher API. Given instance of Gopher[F] need for using most of Gopher operations.

core of Gopher API. Given instance of Gopher[F] need for using most of Gopher operations.

Gopher is a framework, which implements CSP (Communication Sequence Process). Process here - scala units of execution (i.e. functions, blok of code, etc). Communication channels represented by [gopher.Channel]

See also

[gopher.Channel]

[gopher#select]

Source
Gopher.scala
class JVMGopher[F[_]](cfg: JVMGopherConfig)(implicit evidence$1: CpsSchedulingMonad[F]) extends Gopher[F]
Companion
object
Source
JVMGopher.scala
object JVMGopher extends GopherAPI
Companion
class
Source
JVMGopher.scala
case
class JVMGopherConfig(controlExecutor: ExecutorService, taskExecutor: ExecutorService) extends GopherConfig
class JVMTime[F[_]](gopherAPI: JVMGopher[F]) extends Time[F]
trait ReadChannel[F[_], A]

ReadChannel: Interface providing asynchronous reading API.

ReadChannel: Interface providing asynchronous reading API.

Companion
object
Source
ReadChannel.scala
Companion
class
Source
ReadChannel.scala
class Select[F[_]](api: Gopher[F])

Organize waiting for read/write from multiple async channels

Organize waiting for read/write from multiple async channels

Gopher[F] provide a function select of this type.

Source
Select.scala
object SelectFold

Helper namespace for Select.Fold return value

Helper namespace for Select.Fold return value

See also

[Select.fold]

Source
SelectFold.scala
class SelectForever[F[_]](api: Gopher[F]) extends SelectGroupBuilder[F, Unit, Unit]

Result of select.forever: apply method accept partial pseudofunction which evalueated forever.

Result of select.forever: apply method accept partial pseudofunction which evalueated forever.

Source
SelectForever.scala
class SelectGroup[F[_], S](api: Gopher[F]) extends SelectListeners[F, S, S]

Select group is a virtual 'lock' object. Readers and writers are grouped into select groups. When event about avaiability to read or to write is arrived and no current event group members is running, than run of one of the members is triggered. I.e. only one from group can run.

Select group is a virtual 'lock' object. Readers and writers are grouped into select groups. When event about avaiability to read or to write is arrived and no current event group members is running, than run of one of the members is triggered. I.e. only one from group can run.

Note, that application develeper usually not work with SelectGroup directly, it is created internally by select pseudostatement.

See also

[gopher.Select]

[gopher.select]

Source
SelectGroup.scala
abstract
class SelectGroupBuilder[F[_], S, R](api: Gopher[F]) extends SelectListeners[F, S, R]
trait SelectListeners[F[_], S, R]
class SelectLoop[F[_]](api: Gopher[F]) extends SelectGroupBuilder[F, Boolean, Unit]

Shared gopehr api, which is initialized by platofrm part, Primary used for cross-platforming test, you shoul initialize one of platform API behind and then run tests.

Shared gopehr api, which is initialized by platofrm part, Primary used for cross-platforming test, you shoul initialize one of platform API behind and then run tests.

Source
GopherAPI.scala
abstract
class Time[F[_]](gopherAPI: Gopher[F])

Time API, simular to one in golang standard library.

Time API, simular to one in golang standard library.

See also

gopherApi#time

Companion
object
Source
Time.scala
object Time
Companion
class
Source
Time.scala
trait WriteChannel[F[_], A]
class WriteChannelWithExpiration[F[_], A](internal: WriteChannel[F, A], ttl: FiniteDuration, throwTimeouts: Boolean, gopherApi: Gopher[F]) extends WriteChannel[F, A]

Channel, where messages can be exprited.

Channel, where messages can be exprited.

Source
WriteChannelWithExpiration.scala

Value members

Concrete methods

def futureInput[F[_], A](f: F[A])(using g: Gopher[F]): ReadChannel[F, A]

represent F[_] as read channel.

represent F[_] as read channel.

Source
Gopher.scala
def makeChannel[A](bufSize: Int, autoClose: Boolean)(using g: Gopher[_[_]]): Channel[Monad, A, A]

Create Read/Write channel.

Create Read/Write channel.

Value Params
autoClose
  • close after first message was written to channel.
bufSize
  • size of buffer. If it is zero, the channel is unbuffered. (i.e. writer is blocked until reader start processing).
See also

[gopher.Channel]

Source
Gopher.scala
def makeOnceChannel[A]()(using g: Gopher[_[_]]): Channel[Monad, A, A]
def select(using g: Gopher[_[_]]): Select[Monad]

Concrete fields

Extensions

Extensions

extension [F[_], A](c: IterableOnce[A])
def asReadChannel(using g: Gopher[F]): ReadChannel[F, A]
extension [F[_], A](fa: F[A])
def asChannel(using g: Gopher[F]): ReadChannel[F, A]