-
Notifications
You must be signed in to change notification settings - Fork 12
/
scheduler.go
30 lines (27 loc) · 1.37 KB
/
scheduler.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package scheduler
import (
"github.com/iotaledger/hive.go/runtime/module"
"github.com/iotaledger/iota-core/pkg/protocol/engine/blocks"
iotago "github.com/iotaledger/iota.go/v4"
)
type Scheduler interface {
// AddBlock adds a block to the scheduling buffer.
AddBlock(block *blocks.Block)
// IsBlockIssuerReady returns true if the block issuer is ready to issuer a block, i.e., if the block issuer were to add a block to the scheduler, would it be scheduled.
IsBlockIssuerReady(accountID iotago.AccountID, workScores ...iotago.WorkScore) bool
// BasicBufferSize returns the current buffer size of the Scheduler as block count.
BasicBufferSize() int
// ValidatorBufferSize returns the current buffer size of the Scheduler as block count.
ValidatorBufferSize() int
// ReadyBlocksCount returns the number of ready blocks.
ReadyBlocksCount() int
// IssuerQueueBlockCount returns the queue size of the given issuer as block count.
IssuerQueueBlockCount(issuerID iotago.AccountID) int
// IssuerQueueWork returns the queue size of the given issuer in work units.
IssuerQueueWork(issuerID iotago.AccountID) iotago.WorkScore
// ValidatorQueueBlockCount returns the queue size of the given validator as block count.
ValidatorQueueBlockCount(validatorID iotago.AccountID) int
// Reset resets the component to a clean state as if it was created at the last commitment.
Reset()
module.Module
}