java.lang.Object
java.lang.Record
org.bsc.async.v5.BlockingQueueProcessor<E>
- All Implemented Interfaces:
AsyncGeneratorFlow.Dispatcher<E>,AsyncGeneratorFlow.Processor<E>,AsyncGeneratorFlow.Receiver<E>
public record BlockingQueueProcessor<E>(BlockingQueue<AsyncGenerator.Data<E>> queue)
extends Record
implements AsyncGeneratorFlow.Processor<E>
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aBlockingQueueProcessorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatchAsync(AsyncGenerator.Data<E> data) voiddispatchSync(AsyncGenerator.Data<E> data) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.queue()Returns the value of thequeuerecord component.final StringtoString()Returns a string representation of this record class.waitSync()
-
Constructor Details
-
BlockingQueueProcessor
Creates an instance of aBlockingQueueProcessorrecord class.- Parameters:
queue- the value for thequeuerecord component
-
BlockingQueueProcessor
public BlockingQueueProcessor()
-
-
Method Details
-
dispatchSync
- Specified by:
dispatchSyncin interfaceAsyncGeneratorFlow.Dispatcher<E>- Throws:
InterruptedException
-
dispatchAsync
- Specified by:
dispatchAsyncin interfaceAsyncGeneratorFlow.Dispatcher<E>
-
waitSync
- Specified by:
waitSyncin interfaceAsyncGeneratorFlow.Receiver<E>- Throws:
InterruptedException
-
waitAsync
- Specified by:
waitAsyncin interfaceAsyncGeneratorFlow.Receiver<E>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
queue
Returns the value of thequeuerecord component.- Returns:
- the value of the
queuerecord component
-