You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
626 B
26 lines
626 B
4 years ago
|
package requestmanager
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
sttypes "github.com/harmony-one/harmony/p2p/stream/types"
|
||
|
p2ptypes "github.com/harmony-one/harmony/p2p/types"
|
||
|
)
|
||
|
|
||
|
// Requester is the interface to do request
|
||
|
type Requester interface {
|
||
|
DoRequest(ctx context.Context, request sttypes.Request, options ...RequestOption) (sttypes.Response, sttypes.StreamID, error)
|
||
|
}
|
||
|
|
||
|
// Deliverer is the interface to deliver a response
|
||
|
type Deliverer interface {
|
||
|
DeliverResponse(stID sttypes.StreamID, resp sttypes.Response)
|
||
|
}
|
||
|
|
||
|
// RequestManager manages over the requests
|
||
|
type RequestManager interface {
|
||
|
p2ptypes.LifeCycle
|
||
|
Requester
|
||
|
Deliverer
|
||
|
}
|