Documentation ¶
Index ¶
- Constants
- Variables
- type GroupLostEvent
- type Handler
- type Impl
- func (i *Impl) Address() pubcluster.Address
- func (i *Impl) CanRetry(err error) bool
- func (i *Impl) Close()
- func (i *Impl) Complete(message *proto.ClientMessage)
- func (i *Impl) Completed() bool
- func (i *Impl) Deadline() time.Time
- func (i *Impl) EventHandler() proto.ClientMessageHandler
- func (i *Impl) Get() (*proto.ClientMessage, error)
- func (i *Impl) GetWithContext(ctx context.Context) (*proto.ClientMessage, error)
- func (i *Impl) Group() int64
- func (i *Impl) MaybeCanRetry(err error) bool
- func (i *Impl) PartitionID() int32
- func (i *Impl) Request() *proto.ClientMessage
- func (i *Impl) SetEventHandler(handler proto.ClientMessageHandler)
- func (i *Impl) SetGroup(id int64)
- type Invocation
- type Result
- type Service
- func (s *Service) Pause(paused bool)
- func (s *Service) Remove(correlationID int64) error
- func (s *Service) SendRequest(ctx context.Context, inv Invocation) error
- func (s *Service) SendUrgentRequest(ctx context.Context, inv Invocation) error
- func (s *Service) SetHandler(handler Handler)
- func (s *Service) Stop()
- func (s *Service) WriteResponse(msg *proto.ClientMessage) error
Constants ¶
View Source
const (
// EventGroupLost is dispatched if an invocation group is lost, e.g., a connection closed
EventGroupLost = "internal.invocation.grouplost"
)
Variables ¶
View Source
var ErrResponseChannelClosed = errors.New("response channel closed")
Functions ¶
This section is empty.
Types ¶
type GroupLostEvent ¶ added in v1.1.1
func NewGroupLost ¶ added in v1.1.1
func NewGroupLost(groupID int64, err error) *GroupLostEvent
func (*GroupLostEvent) EventName ¶ added in v1.1.1
func (e *GroupLostEvent) EventName() string
type Handler ¶
type Handler interface {
Invoke(invocation Invocation) (groupID int64, err error)
}
type Impl ¶
type Impl struct { RedoOperation bool // contains filtered or unexported fields }
func NewImpl ¶
func NewImpl(clientMessage *proto.ClientMessage, partitionID int32, address pubcluster.Address, deadline time.Time, redoOperation bool) *Impl
func (*Impl) Address ¶
func (i *Impl) Address() pubcluster.Address
func (*Impl) Complete ¶
func (i *Impl) Complete(message *proto.ClientMessage)
func (*Impl) EventHandler ¶
func (i *Impl) EventHandler() proto.ClientMessageHandler
func (*Impl) GetWithContext ¶
func (*Impl) MaybeCanRetry ¶
func (*Impl) PartitionID ¶
func (*Impl) Request ¶
func (i *Impl) Request() *proto.ClientMessage
func (*Impl) SetEventHandler ¶
func (i *Impl) SetEventHandler(handler proto.ClientMessageHandler)
SetEventHandler sets the event handler for the invocation. It should only be called at the site of creation.
type Invocation ¶
type Invocation interface { Complete(message *proto.ClientMessage) Completed() bool EventHandler() proto.ClientMessageHandler Get() (*proto.ClientMessage, error) GetWithContext(ctx context.Context) (*proto.ClientMessage, error) PartitionID() int32 Request() *proto.ClientMessage Address() pubcluster.Address Close() CanRetry(err error) bool Deadline() time.Time Group() int64 SetGroup(id int64) }
type Result ¶
type Result interface { Get() (*proto.ClientMessage, error) GetWithTimeout(duration time.Duration) (*proto.ClientMessage, error) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(handler Handler, ed *event.DispatchService, lg logger.LogAdaptor) *Service
func (*Service) SendRequest ¶ added in v1.1.1
func (s *Service) SendRequest(ctx context.Context, inv Invocation) error
func (*Service) SendUrgentRequest ¶ added in v1.1.1
func (s *Service) SendUrgentRequest(ctx context.Context, inv Invocation) error
func (*Service) SetHandler ¶
func (*Service) WriteResponse ¶ added in v1.1.1
func (s *Service) WriteResponse(msg *proto.ClientMessage) error
Click to show internal directories.
Click to hide internal directories.