AsyncSocketChannelConsumer

final class AsyncSocketChannelConsumer extends AsyncChannelConsumer

A TCP socket Consumer that can be used to send data asynchronously from an Observable. The underlying socket will be closed when the Observable ends

Value Params
host

hostname

port

TCP port number

class AsyncChannelConsumer
class Consumer[Array[Byte], Long]
trait Serializable
trait Observable[Array[Byte]] => Task[Long]
class Object
trait Matchable
class Any

Type members

Inherited classlikes

class AsyncChannelSubscriber(consumerCallback: Callback[Throwable, Long])(implicit val scheduler: Scheduler)
Inherited from
AsyncChannelConsumer

Value members

Concrete methods

override def init(subscriber: AsyncChannelSubscriber): Future[Unit]
Definition Classes
AsyncChannelConsumer

Inherited methods

@unspecialized
def andThen[A](g: Task[Long] => A): Observable[Array[Byte]] => A
Inherited from
Function1
final def apply(source: Observable[Array[Byte]]): Task[Long]

Given a source Observable, convert it into a Task by piggybacking on createSubscriber.

Given a source Observable, convert it into a Task by piggybacking on createSubscriber.

Inherited from
Consumer
@unspecialized
def compose[A](g: A => Observable[Array[Byte]]): A => Task[Long]
Inherited from
Function1
final def contramap[In2](f: In2 => Array[Byte]): Consumer[In2, Long]

Given a contravariant mapping function, transform the source consumer by transforming the input.

Given a contravariant mapping function, transform the source consumer by transforming the input.

Inherited from
Consumer
override def createSubscriber(cb: Callback[Throwable, Long], s: Scheduler): (Subscriber[Array[Byte]], AssignableCancelable)
Definition Classes
AsyncChannelConsumer -> Consumer
Inherited from
AsyncChannelConsumer
final def map[R2](f: Long => R2): Consumer[Array[Byte], R2]

Given a mapping function, when consuming a stream, applies the mapping function to the final result, thus modifying the output of the source consumer.

Given a mapping function, when consuming a stream, applies the mapping function to the final result, thus modifying the output of the source consumer.

Note that for applying the mapping function an asynchronous boundary is forced, otherwise it could trigger a stack overflow exception. For more efficient mapping of the result, it's probably better to map the resulting Task on Observable.consumeWith.

See also

mapTask for a variant that can map the output to a Task that can be processed asynchronously.

Inherited from
Consumer
final def mapEval[F[_], R2](f: Long => F[R2])(implicit F: TaskLike[F]): Consumer[Array[Byte], R2]

Given a mapping function, when consuming a stream, applies the mapping function to the final result, thus modifying the output of the source consumer.

Given a mapping function, when consuming a stream, applies the mapping function to the final result, thus modifying the output of the source consumer.

The mapping function returns results using a generic F[_] data type that must implement the cats.effect.Effect type class. Examples of such classes are cats.effect.IO and monix.eval.Task, thus being able to do asynchronous processing.

See mapTask for the version that's specialized on Task.

Inherited from
Consumer
final def mapTask[R2](f: Long => Task[R2]): Consumer[Array[Byte], R2]

Given a mapping function, when consuming a stream, applies the mapping function to the final result, thus modifying the output of the source consumer.

Given a mapping function, when consuming a stream, applies the mapping function to the final result, thus modifying the output of the source consumer.

The mapping function returns a Task that can be used to process results asynchronously.

Note that for applying the mapping function an asynchronous boundary is forced, otherwise it could trigger a stack overflow exception. For more efficient mapping of the result, it's probably better to map the resulting Task on Observable.consumeWith.

See mapEval for the version that can work with any data type that implements cats.effect.Effect.

Inherited from
Consumer
override def toString(): String
Definition Classes
Function1 -> Any
Inherited from
Function1
final def transformInput[In2](f: Observable[In2] => Observable[Array[Byte]]): Consumer[In2, Long]

Given a function that transforms the input stream, uses it to transform the source consumer into one that accepts events of the type specified by the transformation function.

Given a function that transforms the input stream, uses it to transform the source consumer into one that accepts events of the type specified by the transformation function.

Inherited from
Consumer
Inherited from
AsyncChannelConsumer

Concrete fields

lazy override val channel: Option[AsyncChannel]