Packages

p

fs2

io

package io

Provides various ways to work with streams that perform IO.

These methods accept a blocking ExecutionContext, as the underlying implementations perform blocking IO. The recommendation is to use an unbounded thread pool with application level bounds.

Source
io.scala
See also

https://typelevel.org/cats-effect/concurrency/basics.html#blocking-threads

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. io
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class Watcher[F[_]] extends AnyRef

    Allows watching the file system for changes to directories and files by using the platform's WatchService.

Value Members

  1. def readInputStream[F[_]](fis: F[InputStream], chunkSize: Int, blockingExecutionContext: ExecutionContext, closeAfterUse: Boolean = true)(implicit F: Sync[F], cs: ContextShift[F]): Stream[F, Byte]

    Reads all bytes from the specified InputStream with a buffer size of chunkSize.

    Reads all bytes from the specified InputStream with a buffer size of chunkSize. Set closeAfterUse to false if the InputStream should not be closed after use.

  2. def stdin[F[_]](bufSize: Int, blockingExecutionContext: ExecutionContext)(implicit F: Sync[F], cs: ContextShift[F]): Stream[F, Byte]

    Stream of bytes read asynchronously from standard input.

  3. def stdout[F[_]](blockingExecutionContext: ExecutionContext)(implicit F: Sync[F], cs: ContextShift[F]): Pipe[F, Byte, Unit]

    Pipe of bytes that writes emitted values to standard output asynchronously.

  4. def toInputStream[F[_]](implicit F: ConcurrentEffect[F]): Pipe[F, Byte, InputStream]

    Pipe that converts a stream of bytes to a stream that will emits a single java.io.InputStream, that is closed whenever the resulting stream terminates.

    Pipe that converts a stream of bytes to a stream that will emits a single java.io.InputStream, that is closed whenever the resulting stream terminates.

    If the close of resulting input stream is invoked manually, then this will await until the original stream completely terminates.

    Because all InputStream methods block (including close), the resulting InputStream should be consumed on a different thread pool than the one that is backing the ConcurrentEffect.

    Note that the implementation is not thread safe -- only one thread is allowed at any time to operate on the resulting java.io.InputStream.

  5. def unsafeReadInputStream[F[_]](fis: F[InputStream], chunkSize: Int, blockingExecutionContext: ExecutionContext, closeAfterUse: Boolean = true)(implicit F: Sync[F], cs: ContextShift[F]): Stream[F, Byte]

    Reads all bytes from the specified InputStream with a buffer size of chunkSize.

    Reads all bytes from the specified InputStream with a buffer size of chunkSize. Set closeAfterUse to false if the InputStream should not be closed after use.

    Each read operation is performed on the supplied execution context. Reads are blocking so the execution context should be configured appropriately.

    Recycles an underlying input buffer for performance. It is safe to call this as long as whatever consumes this Stream does not store the Chunk returned or pipe it to a combinator that does (e.g. buffer). Use readInputStream for a safe version.

  6. def writeOutputStream[F[_]](fos: F[OutputStream], blockingExecutionContext: ExecutionContext, closeAfterUse: Boolean = true)(implicit F: Sync[F], cs: ContextShift[F]): Pipe[F, Byte, Unit]

    Writes all bytes to the specified OutputStream.

    Writes all bytes to the specified OutputStream. Set closeAfterUse to false if the OutputStream should not be closed after use.

    Each write operation is performed on the supplied execution context. Writes are blocking so the execution context should be configured appropriately.

  7. object Watcher

Inherited from AnyRef

Inherited from Any

Ungrouped