Documentation ¶
Index ¶
- Variables
- type Engine
- func (n *Engine) AdvertisedAddress() string
- func (n *Engine) Events() <-chan *Event
- func (n *Engine) GetActor(ctx context.Context, actorName string) (*internalpb.WireActor, error)
- func (n *Engine) GetPartition(actorName string) int
- func (n *Engine) KeyExists(ctx context.Context, key string) (bool, error)
- func (n *Engine) NodeHost() string
- func (n *Engine) NodeRemotingPort() int
- func (n *Engine) Peers(ctx context.Context) ([]*Peer, error)
- func (n *Engine) PutActor(ctx context.Context, actor *internalpb.WireActor) error
- func (n *Engine) RemoveActor(ctx context.Context, actorName string) error
- func (n *Engine) SetKey(ctx context.Context, key string) error
- func (n *Engine) Start(ctx context.Context) error
- func (n *Engine) Stop(ctx context.Context) error
- type Event
- type EventType
- type Interface
- type Option
- func WithHasher(hasher hash.Hasher) Option
- func WithLogger(logger log.Logger) Option
- func WithMinimumPeersQuorum(count uint16) Option
- func WithPartitionsCount(count uint64) Option
- func WithReadTimeout(timeout time.Duration) Option
- func WithShutdownTimeout(timeout time.Duration) Option
- func WithWriteTimeout(timeout time.Duration) Option
- type OptionFunc
- type Peer
Constants ¶
This section is empty.
Variables ¶
var ( // ErrActorNotFound is return when an actor is not found ErrActorNotFound = errors.New("actor not found") )
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine represents the Engine
func NewEngine ¶
func NewEngine(name string, disco discovery.Provider, host *discovery.Node, opts ...Option) (*Engine, error)
NewEngine creates an instance of cluster Engine
func (*Engine) AdvertisedAddress ¶
AdvertisedAddress returns the cluster node cluster address that is known by the peers in the cluster
func (*Engine) GetPartition ¶
GetPartition returns the partition where a given actor is stored
func (*Engine) NodeRemotingPort ¶
NodeRemotingPort returns the Node remoting port
func (*Engine) RemoveActor ¶
RemoveActor removes a given actor from the cluster. An actor is removed from the cluster when this actor has been passivated.
type Interface ¶
type Interface interface { // Start starts the cluster engine Start(ctx context.Context) error // Stop stops the cluster engine Stop(ctx context.Context) error // NodeHost returns the cluster startNode host address NodeHost() string // NodeRemotingPort returns the cluster startNode remoting port NodeRemotingPort() int // PutActor replicates onto the Node the metadata of an actor PutActor(ctx context.Context, actor *internalpb.WireActor) error // GetActor fetches an actor from the Node GetActor(ctx context.Context, actorName string) (*internalpb.WireActor, error) // GetPartition returns the partition where a given actor is stored GetPartition(actorName string) int // SetKey sets a given key to the cluster SetKey(ctx context.Context, key string) error // KeyExists checks the existence of a given key KeyExists(ctx context.Context, key string) (bool, error) // RemoveActor removes a given actor from the cluster. // An actor is removed from the cluster when this actor has been passivated. RemoveActor(ctx context.Context, actorName string) error // Events returns a channel where cluster events are published Events() <-chan *Event // AdvertisedAddress returns the cluster node cluster address that is known by the // peers in the cluster AdvertisedAddress() string // Peers returns a channel containing the list of peers at a given time Peers(ctx context.Context) ([]*Peer, error) }
Interface defines the Node interface
type Option ¶
type Option interface { // Apply sets the Option value of a config. Apply(cl *Engine) }
Option is the interface that applies a configuration option.
func WithMinimumPeersQuorum ¶
WithMinimumPeersQuorum sets the minimum number of nodes to form a quorum
func WithPartitionsCount ¶
WithPartitionsCount sets the total number of partitions
func WithReadTimeout ¶
WithReadTimeout sets the Node read timeout. This timeout specifies the timeout of a data retrieval
func WithShutdownTimeout ¶
WithShutdownTimeout sets the Node shutdown timeout.
func WithWriteTimeout ¶
WithWriteTimeout sets the Node write timeout. This timeout specifies the timeout of a data replication