Class/Object

com.fulcrumgenomics.commons.async

AsyncWriter

Related Docs: object AsyncWriter | package async

Permalink

class AsyncWriter[T] extends AsyncSink[T] with Writer[T]

An asynchronous wrapper around a Writer class.

T

the type of object to write

Linear Supertypes
Writer[T], AsyncSink[T], AsyncRunnable, Runnable, Closeable, AutoCloseable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AsyncWriter
  2. Writer
  3. AsyncSink
  4. AsyncRunnable
  5. Runnable
  6. Closeable
  7. AutoCloseable
  8. AnyRef
  9. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AsyncWriter(writer: Writer[T], bufferSize: Option[Int] = None)

    Permalink

    writer

    the writer to wrap

    bufferSize

    the number of elements to buffer before blocking when writing the elements, or None if unbounded

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncWriter[T] to any2stringadd[AsyncWriter[T]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ++=[B <: T](items: TraversableOnce[B]): AsyncWriter.this.type

    Permalink

    Writes an item and returns a reference to the writer.

    Writes an item and returns a reference to the writer.

    Definition Classes
    Writer
  5. def +=(item: T): AsyncWriter.this.type

    Permalink

    Writes an item and returns a reference to the writer.

    Writes an item and returns a reference to the writer.

    Definition Classes
    Writer
  6. def ->[B](y: B): (AsyncWriter[T], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncWriter[T] to ArrowAssoc[AsyncWriter[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  7. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def add(item: T): Unit

    Permalink

    Adds the item to the queue to be processed by sink.

    Adds the item to the queue to be processed by sink.

    item

    the item to queue

    Definition Classes
    AsyncSink
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def awaitDone(): Unit

    Permalink

    Waits for the run() method to complete.

    Waits for the run() method to complete.

    Definition Classes
    AsyncRunnable
  11. def awaitStart(): Unit

    Permalink

    Waits for the run() method to start.

    Waits for the run() method to start.

    Definition Classes
    AsyncRunnable
  12. final def checkAndRaise(): Unit

    Permalink

    Checks to see if an exception has been raised by an asynchronous thread and if so rethrows it.

    Checks to see if an exception has been raised by an asynchronous thread and if so rethrows it. Use this method before code that assumes the threads have not encountered an exception.

    Attributes
    protected
    Definition Classes
    AsyncRunnable
  13. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. def close(): Unit

    Permalink

    Attempts to finish draining the queue and then calls close() on the source to allow implementation to do any one time clean up.

    Attempts to finish draining the queue and then calls close() on the source to allow implementation to do any one time clean up.

    Definition Classes
    AsyncSink → Closeable → AutoCloseable
  15. def done: Boolean

    Permalink

    Returns true if the run() method has completed, false otherwise.

    Returns true if the run() method has completed, false otherwise.

    Definition Classes
    AsyncRunnable
  16. def ensuring(cond: (AsyncWriter[T]) ⇒ Boolean, msg: ⇒ Any): AsyncWriter[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncWriter[T] to Ensuring[AsyncWriter[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. def ensuring(cond: (AsyncWriter[T]) ⇒ Boolean): AsyncWriter[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncWriter[T] to Ensuring[AsyncWriter[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: Boolean, msg: ⇒ Any): AsyncWriter[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncWriter[T] to Ensuring[AsyncWriter[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. def ensuring(cond: Boolean): AsyncWriter[T]

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncWriter[T] to Ensuring[AsyncWriter[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  22. def execute(): Unit

    Permalink

    The method that does the asynchronous work.

    The method that does the asynchronous work.

    Attributes
    protected
    Definition Classes
    AsyncSinkAsyncRunnable
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncWriter[T] to StringFormat[AsyncWriter[T]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  27. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  28. val name: String

    Permalink

    The name of this runnable.

    The name of this runnable. This is used as the name of the thread in thread() as well. The name is created based on the class name and the number of AsyncRunnables already created.

    Definition Classes
    AsyncRunnable
  29. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  30. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. final def run(): Unit

    Permalink
    Definition Classes
    AsyncRunnable → Runnable
  33. val sink: (T) ⇒ Unit

    Permalink

    the method to invoke to process an object of type T.

    the method to invoke to process an object of type T.

    Definition Classes
    AsyncSink
  34. val source: Option[AnyRef { def close(): Unit }]

    Permalink

    the optional source to close when this sink is closed.

    the optional source to close when this sink is closed.

    Definition Classes
    AsyncSink
  35. final def start(name: Option[String] = None, daemon: Boolean = true): AsyncWriter.this.type

    Permalink

    Starts this Runnable in a daemon thread.

    Starts this Runnable in a daemon thread.

    name

    optionally the name of the thread, otherwise a name is created based on the class name and the number of threads already created.

    Definition Classes
    AsyncRunnable
  36. def started: Boolean

    Permalink

    Returns true if the run() method has started, false otherwise.

    Returns true if the run() method has started, false otherwise.

    Definition Classes
    AsyncRunnable
  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  38. final def thread(): Thread

    Permalink

    Creates a new thread wrapping this runnable; the thread is not started.

    Creates a new thread wrapping this runnable; the thread is not started.

    Definition Classes
    AsyncRunnable
  39. def throwable: Option[Throwable]

    Permalink

    Returns a throwable if an exception occurred in the run() method, None otherwise.

    Returns a throwable if an exception occurred in the run() method, None otherwise.

    Definition Classes
    AsyncRunnable
  40. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  41. def tryAndModifyInterruptedException[T](message: String)(f: ⇒ T): T

    Permalink

    Executes the given block of code.

    Executes the given block of code. If an InterruptedException is thrown, throws a RuntimeException with the given message. Use this method for blocking code that when interrupted should not be recoverable.

    message

    the message to use if an InterruptedException is thrown by the block of code

    f

    the block of code to execute

    Attributes
    protected
    Definition Classes
    AsyncRunnable
  42. def uponDone()(implicit ec: ExecutionContext): Awaitable[Option[Throwable]]

    Permalink

    Returns an Awaitable that completes when the run() method has completed.

    Returns an Awaitable that completes when the run() method has completed. Returns the throwable if an exception was encountered, None otherwise.

    Definition Classes
    AsyncRunnable
  43. def uponException(): Unit

    Permalink

    The method to execute if an exception occurs in the asynchronous thread.

    The method to execute if an exception occurs in the asynchronous thread. This should not block.

    Attributes
    protected
    Definition Classes
    AsyncSinkAsyncRunnable
  44. def uponFinally(): Unit

    Permalink

    The method to execute upon successfully execution of the run method or an exception occurs.

    The method to execute upon successfully execution of the run method or an exception occurs. This should not block.

    Attributes
    protected
    Definition Classes
    AsyncRunnable
  45. def uponStart()(implicit ec: ExecutionContext): Awaitable[Unit]

    Permalink

    Returns an Awaitable that completes when the run() method has started.

    Returns an Awaitable that completes when the run() method has started. Returns the throwable if an exception was encountered, None otherwise.

    Definition Classes
    AsyncRunnable
  46. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. def write(item: T): Unit

    Permalink

    Adds the item to the queue for writing.

    Adds the item to the queue for writing.

    Definition Classes
    AsyncWriterWriter
  50. def write[B <: T](items: TraversableOnce[B]): Unit

    Permalink

    Writes out one or more items in order.

    Writes out one or more items in order.

    Definition Classes
    Writer
  51. val writer: Writer[T]

    Permalink

    the writer to wrap

  52. def [B](y: B): (AsyncWriter[T], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncWriter[T] to ArrowAssoc[AsyncWriter[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Writer[T]

Inherited from AsyncSink[T]

Inherited from AsyncRunnable

Inherited from Runnable

Inherited from Closeable

Inherited from AutoCloseable

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from AsyncWriter[T] to any2stringadd[AsyncWriter[T]]

Inherited by implicit conversion StringFormat from AsyncWriter[T] to StringFormat[AsyncWriter[T]]

Inherited by implicit conversion Ensuring from AsyncWriter[T] to Ensuring[AsyncWriter[T]]

Inherited by implicit conversion ArrowAssoc from AsyncWriter[T] to ArrowAssoc[AsyncWriter[T]]

Ungrouped