protoactor-go: github.com/AsynkronIT/protoactor-go/cluster Index | Files | Directories

package cluster

import "github.com/AsynkronIT/protoactor-go/cluster"

Index

Package Files

cluster.go cluster_config.go cluster_provider.go grain.go grain_context.go log.go member_status.go member_status_events.go member_strategy.go memberlist.go memberlist_actor.go partition_actor.go pid_cache.go protos.pb.go rendezvous.go round_robin.go

Variables

var (
    ErrInvalidLengthProtos = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowProtos   = fmt.Errorf("proto: integer overflow")
)

func Get Uses

func Get(name string, kind string) (*actor.PID, remote.ResponseStatusCode)

Get a PID to a virtual actor

func RemoveCache Uses

func RemoveCache(name string)

func SetLogLevel Uses

func SetLogLevel(level log.Level)

SetLogLevel sets the log level for the logger.

SetLogLevel is safe to call concurrently

func Shutdown Uses

func Shutdown(graceful bool)

func Start Uses

func Start(clusterName, address string, provider ClusterProvider)

func StartWithConfig Uses

func StartWithConfig(config *ClusterConfig)

type ActivatorMemberRequest Uses

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

type ClusterConfig Uses

type ClusterConfig struct {
    Name                        string
    Address                     string
    ClusterProvider             ClusterProvider
    RemotingOption              []remote.RemotingOption
    TimeoutTime                 time.Duration
    InitialMemberStatusValue    MemberStatusValue
    MemberStatusValueSerializer MemberStatusValueSerializer
    MemberStrategyBuilder       func(kind string) MemberStrategy
}

func NewClusterConfig Uses

func NewClusterConfig(name string, address string, clusterProvider ClusterProvider) *ClusterConfig

func (*ClusterConfig) WithInitialMemberStatusValue Uses

func (c *ClusterConfig) WithInitialMemberStatusValue(val MemberStatusValue) *ClusterConfig

func (*ClusterConfig) WithMemberStatusValueSerializer Uses

func (c *ClusterConfig) WithMemberStatusValueSerializer(serializer MemberStatusValueSerializer) *ClusterConfig

func (*ClusterConfig) WithMemberStrategyBuilder Uses

func (c *ClusterConfig) WithMemberStrategyBuilder(builder func(kind string) MemberStrategy) *ClusterConfig

func (*ClusterConfig) WithRemotingOption Uses

func (c *ClusterConfig) WithRemotingOption(remotingOption []remote.RemotingOption) *ClusterConfig

func (*ClusterConfig) WithTimeout Uses

func (c *ClusterConfig) WithTimeout(t time.Duration) *ClusterConfig

type ClusterProvider Uses

type ClusterProvider interface {
    RegisterMember(clusterName string, address string, port int, knownKinds []string,
        statusValue MemberStatusValue, serializer MemberStatusValueSerializer) error
    MonitorMemberStatusChanges()
    UpdateMemberStatusValue(statusValue MemberStatusValue) error
    DeregisterMember() error
    Shutdown() error
}

type ClusterTopologyEvent Uses

type ClusterTopologyEvent []*MemberStatus

type Grain Uses

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

func (*Grain) ID Uses

func (g *Grain) ID() string

func (*Grain) Init Uses

func (g *Grain) Init(id string)

type GrainCallConfig Uses

type GrainCallConfig struct {
    RetryCount  int
    Timeout     time.Duration
    RetryAction func(n int)
}

func ApplyGrainCallOptions Uses

func ApplyGrainCallOptions(options []GrainCallOption) *GrainCallConfig

func DefaultGrainCallConfig Uses

func DefaultGrainCallConfig() *GrainCallConfig

type GrainCallOption Uses

type GrainCallOption func(*GrainCallConfig)

func WithRetry Uses

func WithRetry(count int) GrainCallOption

func WithTimeout Uses

func WithTimeout(timeout time.Duration) GrainCallOption

type GrainContext Uses

type GrainContext interface {
    // Watch registers the actor as a monitor for the specified PID
    Watch(pid *actor.PID)

    // Unwatch unregisters the actor as a monitor for the specified PID
    Unwatch(pid *actor.PID)

    // Message returns the current message to be processed
    Message() interface{}

    // Sender returns the PID of actor that sent currently processed message
    Sender() *actor.PID

    //Tell sends a message to the given PID
    Tell(pid *actor.PID, message interface{})

    //Request sends a message to the given PID and also provides a Sender PID
    Request(pid *actor.PID, message interface{})

    // RequestFuture sends a message to a given PID and returns a Future
    RequestFuture(pid *actor.PID, message interface{}, timeout time.Duration) *actor.Future

    // Self returns the PID for the current actor
    Self() *actor.PID

    // Spawn starts a new child actor based on props and named with a unique id
    Spawn(props *actor.Props) *actor.PID

    // SpawnPrefix starts a new child actor based on props and named using a prefix followed by a unique id
    SpawnPrefix(props *actor.Props, prefix string) *actor.PID

    // SpawnNamed starts a new child actor based on props and named using the specified name
    //
    // ErrNameExists will be returned if id already exists
    SpawnNamed(props *actor.Props, id string) (*actor.PID, error)

    // Returns a slice of the actors children
    Children() []*actor.PID
}

type GrainErrorResponse Uses

type GrainErrorResponse struct {
    Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
}

func (*GrainErrorResponse) Descriptor Uses

func (*GrainErrorResponse) Descriptor() ([]byte, []int)

func (*GrainErrorResponse) Equal Uses

func (this *GrainErrorResponse) Equal(that interface{}) bool

func (*GrainErrorResponse) Marshal Uses

func (m *GrainErrorResponse) Marshal() (dAtA []byte, err error)

func (*GrainErrorResponse) MarshalTo Uses

func (m *GrainErrorResponse) MarshalTo(dAtA []byte) (int, error)

func (*GrainErrorResponse) ProtoMessage Uses

func (*GrainErrorResponse) ProtoMessage()

func (*GrainErrorResponse) Reset Uses

func (m *GrainErrorResponse) Reset()

func (*GrainErrorResponse) Size Uses

func (m *GrainErrorResponse) Size() (n int)

func (*GrainErrorResponse) String Uses

func (this *GrainErrorResponse) String() string

func (*GrainErrorResponse) Unmarshal Uses

func (m *GrainErrorResponse) Unmarshal(dAtA []byte) error

type GrainRequest Uses

type GrainRequest struct {
    Method      string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
    MessageData []byte `protobuf:"bytes,2,opt,name=message_data,json=messageData,proto3" json:"message_data,omitempty"`
}

func (*GrainRequest) Descriptor Uses

func (*GrainRequest) Descriptor() ([]byte, []int)

func (*GrainRequest) Equal Uses

func (this *GrainRequest) Equal(that interface{}) bool

func (*GrainRequest) Marshal Uses

func (m *GrainRequest) Marshal() (dAtA []byte, err error)

func (*GrainRequest) MarshalTo Uses

func (m *GrainRequest) MarshalTo(dAtA []byte) (int, error)

func (*GrainRequest) ProtoMessage Uses

func (*GrainRequest) ProtoMessage()

func (*GrainRequest) Reset Uses

func (m *GrainRequest) Reset()

func (*GrainRequest) Size Uses

func (m *GrainRequest) Size() (n int)

func (*GrainRequest) String Uses

func (this *GrainRequest) String() string

func (*GrainRequest) Unmarshal Uses

func (m *GrainRequest) Unmarshal(dAtA []byte) error

type GrainResponse Uses

type GrainResponse struct {
    MessageData []byte `protobuf:"bytes,1,opt,name=message_data,json=messageData,proto3" json:"message_data,omitempty"`
}

func (*GrainResponse) Descriptor Uses

func (*GrainResponse) Descriptor() ([]byte, []int)

func (*GrainResponse) Equal Uses

func (this *GrainResponse) Equal(that interface{}) bool

func (*GrainResponse) Marshal Uses

func (m *GrainResponse) Marshal() (dAtA []byte, err error)

func (*GrainResponse) MarshalTo Uses

func (m *GrainResponse) MarshalTo(dAtA []byte) (int, error)

func (*GrainResponse) ProtoMessage Uses

func (*GrainResponse) ProtoMessage()

func (*GrainResponse) Reset Uses

func (m *GrainResponse) Reset()

func (*GrainResponse) Size Uses

func (m *GrainResponse) Size() (n int)

func (*GrainResponse) String Uses

func (this *GrainResponse) String() string

func (*GrainResponse) Unmarshal Uses

func (m *GrainResponse) Unmarshal(dAtA []byte) error

type MemberAvailableEvent Uses

type MemberAvailableEvent struct {
    MemberMeta
}

func (*MemberAvailableEvent) MemberStatusEvent Uses

func (*MemberAvailableEvent) MemberStatusEvent()

type MemberJoinedEvent Uses

type MemberJoinedEvent struct {
    MemberMeta
}

func (*MemberJoinedEvent) MemberStatusEvent Uses

func (*MemberJoinedEvent) MemberStatusEvent()

type MemberLeftEvent Uses

type MemberLeftEvent struct {
    MemberMeta
}

func (*MemberLeftEvent) MemberStatusEvent Uses

func (*MemberLeftEvent) MemberStatusEvent()

type MemberMeta Uses

type MemberMeta struct {
    Host  string
    Port  int
    Kinds []string
}

func (*MemberMeta) GetKinds Uses

func (e *MemberMeta) GetKinds() []string

func (*MemberMeta) Name Uses

func (e *MemberMeta) Name() string

type MemberRejoinedEvent Uses

type MemberRejoinedEvent struct {
    MemberMeta
}

func (*MemberRejoinedEvent) MemberStatusEvent Uses

func (*MemberRejoinedEvent) MemberStatusEvent()

type MemberResponse Uses

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

type MemberStatus Uses

type MemberStatus struct {
    MemberID    string
    Host        string
    Port        int
    Kinds       []string
    Alive       bool
    StatusValue MemberStatusValue
}

func (*MemberStatus) Address Uses

func (m *MemberStatus) Address() string

type MemberStatusEvent Uses

type MemberStatusEvent interface {
    MemberStatusEvent()
    GetKinds() []string
}

type MemberStatusValue Uses

type MemberStatusValue interface {
    IsSame(val MemberStatusValue) bool
}

type MemberStatusValueSerializer Uses

type MemberStatusValueSerializer interface {
    ToValueBytes(val MemberStatusValue) []byte
    FromValueBytes(val []byte) MemberStatusValue
}

type MemberStrategy Uses

type MemberStrategy interface {
    GetAllMembers() []*MemberStatus
    AddMember(member *MemberStatus)
    UpdateMember(member *MemberStatus)
    RemoveMember(member *MemberStatus)
    GetPartition(key string) string
    GetActivator() string
}

type MemberUnavailableEvent Uses

type MemberUnavailableEvent struct {
    MemberMeta
}

func (*MemberUnavailableEvent) MemberStatusEvent Uses

func (*MemberUnavailableEvent) MemberStatusEvent()

type MembersByKindRequest Uses

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

type MembersResponse Uses

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

type NilMemberStatusValueSerializer Uses

type NilMemberStatusValueSerializer struct{}

func (*NilMemberStatusValueSerializer) FromValueBytes Uses

func (s *NilMemberStatusValueSerializer) FromValueBytes(val []byte) MemberStatusValue

func (*NilMemberStatusValueSerializer) ToValueBytes Uses

func (s *NilMemberStatusValueSerializer) ToValueBytes(val MemberStatusValue) []byte

type PartitionMemberRequest Uses

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

type Rendezvous Uses

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

func NewRendezvous Uses

func NewRendezvous(memberStrategy MemberStrategy) *Rendezvous

func (*Rendezvous) GetByRdv Uses

func (r *Rendezvous) GetByRdv(key string) string

Get returns the node with the highest score for the given key. If this Hash has no nodes, an empty string is returned.

func (*Rendezvous) UpdateRdv Uses

func (r *Rendezvous) UpdateRdv()

type SimpleRoundRobin Uses

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

func NewSimpleRoundRobin Uses

func NewSimpleRoundRobin(memberStrategy MemberStrategy) *SimpleRoundRobin

func (*SimpleRoundRobin) GetByRoundRobin Uses

func (r *SimpleRoundRobin) GetByRoundRobin() string

type TakeOwnership Uses

type TakeOwnership struct {
    Pid  *actor.PID `protobuf:"bytes,1,opt,name=pid" json:"pid,omitempty"`
    Name string     `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
}

func (*TakeOwnership) Descriptor Uses

func (*TakeOwnership) Descriptor() ([]byte, []int)

func (*TakeOwnership) Equal Uses

func (this *TakeOwnership) Equal(that interface{}) bool

func (*TakeOwnership) GetPid Uses

func (m *TakeOwnership) GetPid() *actor.PID

func (*TakeOwnership) Marshal Uses

func (m *TakeOwnership) Marshal() (dAtA []byte, err error)

func (*TakeOwnership) MarshalTo Uses

func (m *TakeOwnership) MarshalTo(dAtA []byte) (int, error)

func (*TakeOwnership) ProtoMessage Uses

func (*TakeOwnership) ProtoMessage()

func (*TakeOwnership) Reset Uses

func (m *TakeOwnership) Reset()

func (*TakeOwnership) Size Uses

func (m *TakeOwnership) Size() (n int)

func (*TakeOwnership) String Uses

func (this *TakeOwnership) String() string

func (*TakeOwnership) Unmarshal Uses

func (m *TakeOwnership) Unmarshal(dAtA []byte) error

Directories

PathSynopsis
consul
weighted

Package cluster imports 17 packages (graph) and is imported by 2 packages. Updated 2017-10-18. Refresh now. Tools for package owners.