Class: ProposalsBatch
market/proposal/proposals_batch.ProposalsBatch
Proposals Batch aggregates initial proposals and returns a set grouped by the provider's key to avoid duplicate offers issued by the provider.
Table of contents
Constructors
Methods
Constructors
constructor
• new ProposalsBatch(options?
): ProposalsBatch
Parameters
Name | Type |
---|---|
options? | ProposalsBatchOptions |
Returns
Defined in
src/market/proposal/proposals_batch.ts:27
Methods
addProposal
▸ addProposal(proposal
): Promise
<void
>
Add proposal to the batch grouped by provider key which consist of providerId, cores, threads, mem and storage
Parameters
Name | Type |
---|---|
proposal | OfferProposal |
Returns
Promise
<void
>
Defined in
src/market/proposal/proposals_batch.ts:38
getProposals
▸ getProposals(): Promise
<OfferProposal
[]>
Returns the batched proposals from the internal buffer and empties it
Returns
Promise
<OfferProposal
[]>
Defined in
src/market/proposal/proposals_batch.ts:53
waitForProposals
▸ waitForProposals(): Promise
<void
>
Waits for the max amount time for batching or max batch size to be reached before it makes sense to process events
Used to flow-control the consumption of the proposal events from the batch. The returned promise resolves when it is time to process the buffered proposal events.
Returns
Promise
<void
>