invocation

package
v1.0.0-preview.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrResponseChannelClosed = errors.New("response channel closed")

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Invoke(invocation Invocation) error
}

type Impl

type Impl struct {
	// contains filtered or unexported fields
}

func NewImpl

func NewImpl(clientMessage *proto.ClientMessage, partitionID int32, address *pubcluster.AddressImpl, deadline time.Time, redoOperation bool) *Impl

func (*Impl) Address

func (i *Impl) Address() *pubcluster.AddressImpl

func (*Impl) CanRetry

func (i *Impl) CanRetry(err error) bool

func (*Impl) Close

func (i *Impl) Close()

func (*Impl) Complete

func (i *Impl) Complete(message *proto.ClientMessage)

func (*Impl) Completed

func (i *Impl) Completed() bool

func (*Impl) EventHandler

func (i *Impl) EventHandler() proto.ClientMessageHandler

func (*Impl) Get

func (i *Impl) Get() (*proto.ClientMessage, error)

func (*Impl) GetWithContext

func (i *Impl) GetWithContext(ctx context.Context) (*proto.ClientMessage, error)

func (*Impl) PartitionID

func (i *Impl) PartitionID() int32

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.AddressImpl
	Close()
	CanRetry(err error) bool
}

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(
	requestCh <-chan Invocation,
	responseCh <-chan *proto.ClientMessage,
	removeCh <-chan int64,
	handler Handler,
	logger ilogger.Logger) *Service

func (*Service) SetHandler

func (s *Service) SetHandler(handler Handler)

func (*Service) Stop

func (s *Service) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL