-
Notifications
You must be signed in to change notification settings - Fork 174
/
requester.go
28 lines (24 loc) · 1.22 KB
/
requester.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
package module
import (
"github.com/onflow/flow-go/model/flow"
)
type Requester interface {
// EntityByID will request an entity through the request engine backing
// the interface. The additional selector will be applied to the subset
// of valid providers for the entity and allows finer-grained control
// over which providers to request a given entity from. Use `filter.Any`
// if no additional restrictions are required. Data integrity of response
// will be checked upon arrival. This function should be used for requesting
// entites by their IDs.
EntityByID(entityID flow.Identifier, selector flow.IdentityFilter)
// Query will request data through the request engine backing the interface.
// The additional selector will be applied to the subset
// of valid providers for the data and allows finer-grained control
// over which providers to request data from. Doesn't perform integrity check
// can be used to get entities without knowing their ID.
Query(key flow.Identifier, selector flow.IdentityFilter)
// Force will force the dispatcher to send all possible batches immediately.
// It can be used in cases where responsiveness is of utmost importance, at
// the cost of additional network messages.
Force()
}