FS2Channel

jsonrpclib.fs2.FS2Channel
See theFS2Channel companion object
trait FS2Channel[F[_]] extends Channel[F]

A JSON-RPC communication channel built on top of fs2.Stream.

FS2Channel[F] enables streaming JSON-RPC messages into and out of an effectful system. It provides methods to register handlers (Endpoint[F]) for specific method names.

This is the primary server-side integration point for using JSON-RPC over FS2.

Attributes

Companion
object
Graph
Supertypes
trait Channel[F]
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def input: (F, Message) => Unit
def inputOrBounce: (F, Either[ProtocolError, Message]) => Unit
def output: Stream[F, Message]

Concrete methods

def withEndpoint(endpoint: Endpoint[F])(implicit F: Functor[F]): Resource[F, FS2Channel[F]]
def withEndpointStream(endpoint: Endpoint[F])(implicit F: MonadCancelThrow[F]): Stream[F, FS2Channel[F]]
def withEndpointStream(endpoint: Endpoint[F], rest: Endpoint[F]*)(implicit F: MonadCancelThrow[F]): Stream[F, FS2Channel[F]]
def withEndpoints(endpoint: Endpoint[F], rest: Endpoint[F]*)(implicit F: Monad[F]): Resource[F, FS2Channel[F]]
def withEndpoints(endpoints: Seq[Endpoint[F]])(implicit F: Monad[F]): Resource[F, FS2Channel[F]]
def withEndpointsStream(endpoints: Seq[Endpoint[F]])(implicit F: MonadCancelThrow[F]): Stream[F, FS2Channel[F]]

Inherited and Abstract methods

def mountEndpoint(endpoint: Endpoint[F]): F[Unit]

Attributes

Inherited from:
Channel
def notificationStub[In : Encoder](method: String): In => F[Unit]

Attributes

Inherited from:
Channel
def simpleStub[In : Encoder, Out : Decoder](method: String): In => F[Out]

Attributes

Inherited from:
Channel
def stub[In, Err, Out](template: StubTemplate[In, Err, Out]): In => F[Either[Err, Out]]

Attributes

Inherited from:
Channel
def stub[In : Encoder, Err : ErrorDecoder, Out : Decoder](method: String): In => F[Either[Err, Out]]

Attributes

Inherited from:
Channel
def unmountEndpoint(method: String): F[Unit]

Attributes

Inherited from:
Channel