monix.nio.file

Type members

Classlikes

abstract class AsyncFileChannel extends AutoCloseable

An asynchronous channel for reading, writing, and manipulating a file.

An asynchronous channel for reading, writing, and manipulating a file.

On the JVM this is a wrapper around java.nio.channels.AsynchronousFileChannel (class available since Java 7 for doing async I/O on files).

Example
 val out = AsyncFileChannel(File.createTempFile, StandardOpenOption.CREATE)
 val bytes = ByteBuffer.wrap("Hello world!".getBytes("UTF-8"))
 val future = out.write(bytes, 0)
 future.onComplete {
   case Success(nr) =>
     println("Bytes written: %d".format(nr))
   case Failure(exc) =>
     println(s"ERROR: " + exc.getMessage)
 }
Companion
object
Companion
class
final class AsyncFileChannelConsumer(taskFileChannel: TaskFileChannel, startPosition: Long) extends AsyncChannelConsumer
final class AsyncFileChannelObservable(taskFileChannel: TaskFileChannel, size: Int) extends AsyncChannelObservable
abstract class TaskFileChannel

A Task based asynchronous channel for reading, writing, and manipulating a file.

A Task based asynchronous channel for reading, writing, and manipulating a file.

On the JVM this is a wrapper around java.nio.channels.AsynchronousFileChannel (class available since Java 7 for doing async I/O on files).

Example
 val out = TaskFileChannel(File.createTempFile, StandardOpenOption.CREATE)
 val bytes = ByteBuffer.wrap("Hello world!".getBytes("UTF-8"))
 out.write(bytes, 0).runAsync(new Callback[Int] {
   override def onError(ex: Throwable) = println(s"ERROR: " + ex.getMessage)
   override def onSuccess(value: Int) = println("Bytes written: %d".format(value))
 })
Companion
object
Companion
class
abstract class TaskWatchService

A Task based watch service that watches registered objects for changes and events. For example a file manager may use a watch service to monitor a directory for changes so that it can update its display of the list of files when files are created or deleted.

A Task based watch service that watches registered objects for changes and events. For example a file manager may use a watch service to monitor a directory for changes so that it can update its display of the list of files when files are created or deleted.

On the JVM this is a wrapper around java.nio.file.WatchService (class available since Java 7 for registering objects for changes and events).

Companion
object
Companion
class
abstract class WatchService extends AutoCloseable

A watch service that watches registered objects for changes and events. For example a file manager may use a watch service to monitor a directory for changes so that it can update its display of the list of files when files are created or deleted.

A watch service that watches registered objects for changes and events. For example a file manager may use a watch service to monitor a directory for changes so that it can update its display of the list of files when files are created or deleted.

On the JVM this is a wrapper around java.nio.file.WatchService (class available since Java 7 for registering objects for changes and events).

Companion
object
object WatchService
Companion
class

Value members

Concrete methods

def appendAsync(path: Path, startPosition: Long, flags: Seq[StandardOpenOption])(implicit s: Scheduler): AsyncFileChannelConsumer
def readAsync(path: Path, chunkSize: Int)(implicit s: Scheduler): AsyncFileChannelObservable
def watchAsync(path: Path, events: Seq[Kind[_]])(implicit s: Scheduler): WatchServiceObservable
def writeAsync(path: Path, flags: Seq[StandardOpenOption])(implicit s: Scheduler): AsyncFileChannelConsumer