Writes an item and returns a reference to the writer.
Writes an item and returns a reference to the writer.
Writes an item and returns a reference to the writer.
Writes an item and returns a reference to the writer.
Adds the item to the queue to be processed by sink.
Waits for the run() method to complete.
Waits for the run() method to complete.
Waits for the run() method to start.
Waits for the run() method to start.
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.
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.
Returns true if the run() method has completed, false otherwise.
Returns true if the run() method has completed, false otherwise.
The method that does the asynchronous work.
The method that does the asynchronous work.
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.
the method to invoke to process an object of type T.
the method to invoke to process an object of type T.
the optional source to close when this sink is closed.
the optional source to close when this sink is closed.
Starts this Runnable in a daemon thread.
Starts this Runnable in a daemon thread.
optionally the name of the thread, otherwise a name is created based on the class name and the number of threads already created.
Returns true if the run() method has started, false otherwise.
Returns true if the run() method has started, false otherwise.
Creates a new thread wrapping this runnable; the thread is not started.
Creates a new thread wrapping this runnable; the thread is not started.
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.
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.
the message to use if an InterruptedException is thrown by the block of code
the block of code to execute
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.
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.
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.
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.
Adds the item to the queue for writing.
Adds the item to the queue for writing.
Writes out one or more items in order.
Writes out one or more items in order.
the writer to wrap
An asynchronous wrapper around a Writer class.
the type of object to write