JS API Reference
Class: ProposalsBatch
market/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/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 | Proposal |
Returns
Promise
<void
>
Defined in
src/market/proposals_batch.ts:38
readProposals
▸ readProposals(): AsyncGenerator
<Proposal
[], any
, unknown
>
Generates a set of proposals that were collected within the specified releaseTimeoutMs
or their size reached the minBatchSize
value
Returns
AsyncGenerator
<Proposal
[], any
, unknown
>