Class AsyncBuffer<T>

java.lang.Object
adaptlil.buffer.AsyncBuffer<T>
Type Parameters:
T -

public class AsyncBuffer<T> extends Object
Generically typed buffer that supports Asynchronous operations.
  • Field Details

  • Constructor Details

    • AsyncBuffer

      public AsyncBuffer()
  • Method Details

    • write

      public void write(T data)
      Uses and entrant lock and blocks the main thread from writing until the lock is released
      Parameters:
      data -
    • read

      public T read()
      Blocks the main thread from reading until the lock is released.
      Returns:
    • flush

      public void flush()
      Flush the queue
    • size

      public int size()
    • isEmpty

      public boolean isEmpty()