| IRingbufferTAddAllAsyncTE Method |
Adds all the items of a collection to the tail of the Ringbuffer.
Namespace:
Hazelcast.Core
Assembly:
Hazelcast.Net (in Hazelcast.Net.dll) Version: 3.12.2
Syntax Task<long> AddAllAsync<TE>(
ICollection<TE> collection,
OverflowPolicy overflowPolicy
)
where TE : T
Function AddAllAsync(Of TE As T) (
collection As ICollection(Of TE),
overflowPolicy As OverflowPolicy
) As Task(Of Long)
generic<typename TE>
where TE : T
Task<long long>^ AddAllAsync(
ICollection<TE>^ collection,
OverflowPolicy overflowPolicy
)
abstract AddAllAsync :
collection : ICollection<'TE> *
overflowPolicy : OverflowPolicy -> Task<int64> when 'TE : 'T
Parameters
- collection
- Type: System.Collections.GenericICollectionTE
the batch of items to add. - overflowPolicy
- Type: Hazelcast.CoreOverflowPolicy
overflow policy to use
Type Parameters
- TE
Return Value
Type:
TaskInt64the ICompletableFuture to synchronize on completion.
Exceptions Exception | Condition |
---|
ArgumentNullException |
if batch is null,
or if an item in this batch is null
or if overflowPolicy is null
|
ArgumentException | if collection is empty |
Remarks
Adds all the items of a collection to the tail of the Ringbuffer.
A addAll is likely to outperform multiple calls to
Add(T)
due to better io utilization and a reduced number
of executed operations.
If the batch is empty, the call is ignored.
When the collection is not empty, the content is copied into a different data-structure. This means that:
- after this call completes, the collection can be re-used.
- the collection doesn't need to be serializable
If the collection is larger than the capacity of the ringbuffer, then the items that were written first will
be overwritten. Therefor this call will not block.
The items are inserted in the order of the Iterator of the collection. If an addAll is executed concurrently with
an add or addAll, no guarantee is given that items are contiguous.
The result of the future contains the sequenceId of the last written item
See Also