Struct Channel
Thread-safe typed data channel implementation.
struct Channel(T, ulong buffer_size = 100)
;
The implementation supports multiple-reader-multiple-writer operation across
multiple tasks in multiple threads.
Fields
Name | Type | Description |
m_impl
|
shared(ChannelImpl!(T,buffer_size)) | |
Properties
Name | Type | Description |
bufferFill [get]
|
size_t | Returns the current count of items in the buffer.
|
empty [get]
|
bool | Determines whether there is more data to read in a single-reader scenario.
|
Methods
Name | Description |
close
()
|
Closes the channel.
|
consumeAll
(dst)
|
Attempts to consume all elements currently in the queue.
|
consumeOne
()
|
Consumes a single element off the queue.
|
put
(item)
|
Enqueues an element.
|
tryConsumeOne
(dst)
|
Attempts to consume a single element.
|