persistence

package
v0.0.0-...-196067f Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Using

func Using(provider Provider) func(next actor.ActorFunc) actor.ActorFunc

Types

type InMemoryProvider

type InMemoryProvider struct {
	*NoSnapshotSupport
	// contains filtered or unexported fields
}
var InMemory *InMemoryProvider = &InMemoryProvider{}

func (*InMemoryProvider) GetEvents

func (provider *InMemoryProvider) GetEvents(actorName string, callback func(event interface{}))

func (*InMemoryProvider) PersistEvent

func (provider *InMemoryProvider) PersistEvent(actorName string, eventIndex int, event proto.Message)

type Mixin

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

func (*Mixin) Name

func (mixin *Mixin) Name() string

func (*Mixin) PersistReceive

func (mixin *Mixin) PersistReceive(message proto.Message)

func (*Mixin) PersistSnapshot

func (mixin *Mixin) PersistSnapshot(snapshot proto.Message)

func (*Mixin) Recovering

func (mixin *Mixin) Recovering() bool

type NoSnapshotSupport

type NoSnapshotSupport struct {
}

func (*NoSnapshotSupport) GetPersistSnapshot

func (provider *NoSnapshotSupport) GetPersistSnapshot(actorName string) func(snapshot interface{})

func (*NoSnapshotSupport) GetSnapshot

func (provider *NoSnapshotSupport) GetSnapshot(actorName string) (interface{}, bool)

func (*NoSnapshotSupport) GetSnapshotInterval

func (provider *NoSnapshotSupport) GetSnapshotInterval() int

type OfferSnapshot

type OfferSnapshot struct {
	Snapshot interface{}
}

type Provider

type Provider interface {
	GetState() ProviderState
}

Provider is the abstraction used for persistence

type ProviderState

type ProviderState interface {
	Restart()
	GetSnapshotInterval() int
	GetSnapshot(actorName string) (snapshot interface{}, eventIndex int, ok bool)
	GetEvents(actorName string, eventIndexStart int, callback func(e interface{}))
	PersistEvent(actorName string, eventIndex int, event proto.Message)
	PersistSnapshot(actorName string, eventIndex int, snapshot proto.Message)
}

type Replay

type Replay struct{}

type ReplayComplete

type ReplayComplete struct{}

type RequestSnapshot

type RequestSnapshot struct{}

Jump to

Keyboard shortcuts

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