ServerSocket

korolev.effect.io.ServerSocket
See theServerSocket companion object
class ServerSocket[F[_], B](channel: AsynchronousServerSocketChannel, bufferSize: Int)(implicit evidence$1: Effect[F], evidence$2: BytesLike[B]) extends Stream[F, RawDataSocket[F, B]]

Stream API for AsynchronousServerSocketChannel. Use ServerSocket.bind to start listening.

Attributes

See also

AsynchronousServerSocketChannel

Companion
object
Graph
Supertypes
class Stream[F, RawDataSocket[F, B]]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def cancel(): F[Unit]
def pull(): F[Option[RawDataSocket[F, B]]]

Inherited methods

def ++(rhs: Stream[F, RawDataSocket[F, B]]): Stream[F, A]

Attributes

See also

concat

Inherited from:
Stream
def buffer(duration: FiniteDuration)(implicit scheduler: Scheduler[F]): Stream[F, Seq[A]]

Attributes

Inherited from:
Stream
def collect[B](f: PartialFunction[RawDataSocket[F, B], B]): Stream[F, B]

Attributes

Inherited from:
Stream
def concat(rhs: Stream[F, RawDataSocket[F, B]]): Stream[F, A]

Sequently concat two streams

Sequently concat two streams

 Stream(1,2,3) ++ Stream(4,5,6)
 // 1,2,3,4,5,6

Attributes

Inherited from:
Stream
def flatMap[B](f: RawDataSocket[F, B] => Stream[F, B]): Stream[F, B]

Attributes

See also

flatMapConcat

Inherited from:
Stream
def flatMapAsync[B](f: RawDataSocket[F, B] => F[Stream[F, B]]): Stream[F, B]

Attributes

Inherited from:
Stream
def flatMapConcat[B](f: RawDataSocket[F, B] => Stream[F, B]): Stream[F, B]

Merges underlying streams to one line.

Merges underlying streams to one line.

 Stream.eval(1, 2, 3) flatMapConcat { x =>
   Stream.eval(x + "a", x + "b", x + "c")
 }
 // 1a,1b,1c,2a,2b,2c,3a,3b,3c

Attributes

Inherited from:
Stream
def flatMapMerge[B](concurrency: Int)(f: RawDataSocket[F, B] => Stream[F, B]): Stream[F, B]

Merges underlying streams concurrently.

Merges underlying streams concurrently.

Value parameters

concurrency

number of concurrent underlying streams

 Stream.eval(1, 2, 3) flatMapMerge(3) { x =>
   Stream.eval(x + "a", x + "b", x + "c")
 }
 // 1a,2a,3a,1b,2b,3b,1c,2c,3c

Attributes

Inherited from:
Stream
def flatMapMergeAsync[B](concurrency: Int)(f: RawDataSocket[F, B] => F[Stream[F, B]]): Stream[F, B]

Attributes

Inherited from:
Stream
def fold[B](default: B)(f: (B, RawDataSocket[F, B]) => B): F[B]

Attributes

Inherited from:
Stream
def foldAsync[B](default: B)(f: (B, RawDataSocket[F, B]) => F[B]): F[B]

Attributes

Inherited from:
Stream
def foreach(f: RawDataSocket[F, B] => F[Unit]): F[Unit]

Attributes

Inherited from:
Stream
def handleConsumed: (F[Unit], Stream[F, A])

Attributes

Inherited from:
Stream
def map[B](f: RawDataSocket[F, B] => B): Stream[F, B]

Attributes

Inherited from:
Stream
def mapAsync[B](f: RawDataSocket[F, B] => F[B]): Stream[F, B]

Attributes

Inherited from:
Stream
def over[B](default: B)(f: (B, Option[RawDataSocket[F, B]]) => F[B]): Stream[F, A]

React on values of the stream keeping it the same. Useful when you want to track progress of downloading.

React on values of the stream keeping it the same. Useful when you want to track progress of downloading.

 file
   .over(0L) {
     case (acc, chunk) =>
       val loaded = chunk.fold(acc)(_.length.toLong + acc)
       showProgress(loaded, file.bytesLength)
   }
   .to(s3bucket("my-large-file"))

Attributes

Inherited from:
Stream
def sort(numRacks: Int)(f: RawDataSocket[F, B] => Int): List[Stream[F, A]]

Sort elements of the stream between "racks".

Sort elements of the stream between "racks".

 val List(girls, boys, queers) = persons.sort(3) {
   case person if person.isFemale => 0
   case person if person.isMale => 1
   case person => 2
 }

Value parameters

f

Takes element of the stream return number of rack.

numRacks

Number of racks.

Attributes

Returns

List of streams appropriate to racks.

Inherited from:
Stream
def to[U](f: Stream[F, RawDataSocket[F, B]] => F[U]): F[U]

Attributes

Inherited from:
Stream