github.com/koko1123/flow-go-1@v0.29.6/module/requester.go (about)

     1  package module
     2  
     3  import (
     4  	"github.com/koko1123/flow-go-1/model/flow"
     5  )
     6  
     7  type Requester interface {
     8  	// EntityByID will request an entity through the request engine backing
     9  	// the interface. The additional selector will be applied to the subset
    10  	// of valid providers for the entity and allows finer-grained control
    11  	// over which providers to request a given entity from. Use `filter.Any`
    12  	// if no additional restrictions are required. Data integrity of response
    13  	// will be checked upon arrival. This function should be used for requesting
    14  	// entites by their IDs.
    15  	EntityByID(entityID flow.Identifier, selector flow.IdentityFilter)
    16  
    17  	// Query will request data through the request engine backing the interface.
    18  	// The additional selector will be applied to the subset
    19  	// of valid providers for the data and allows finer-grained control
    20  	// over which providers to request data from. Doesn't perform integrity check
    21  	// can be used to get entities without knowing their ID.
    22  	Query(key flow.Identifier, selector flow.IdentityFilter)
    23  
    24  	// Force will force the dispatcher to send all possible batches immediately.
    25  	// It can be used in cases where responsiveness is of utmost importance, at
    26  	// the cost of additional network messages.
    27  	Force()
    28  }