invocation

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

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

type GroupLostEvent struct {
	Err     error
	GroupID int64
}

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) 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) Deadline added in v1.1.1

func (i *Impl) Deadline() time.Time

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) Group added in v1.1.1

func (i *Impl) Group() int64

func (*Impl) MaybeCanRetry

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

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.

func (*Impl) SetGroup added in v1.1.1

func (i *Impl) SetGroup(id int64)

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,
	eventDispatcher *event.DispatchService,
	logger logger.LogAdaptor) *Service

func (*Service) Remove added in v1.1.1

func (s *Service) Remove(correlationID int64) error

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 (s *Service) SetHandler(handler Handler)

func (*Service) Stop

func (s *Service) Stop()

func (*Service) WriteResponse added in v1.1.1

func (s *Service) WriteResponse(msg *proto.ClientMessage) error

Jump to

Keyboard shortcuts

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