Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Def ¶
type Def struct {
// contains filtered or unexported fields
}
Def defines a saga type
func (*Def) HandleEvent ¶
func (sd *Def) HandleEvent(exchange, topic string, event gbus.Message, handler gbus.MessageHandler) error
HandleEvent implements HandlerRegister interface
func (*Def) HandleMessage ¶
HandleMessage implements HandlerRegister interface
type Glue ¶
type Glue struct {
// contains filtered or unexported fields
}
Glue ties the incoming messages from the Bus with the needed Saga instances
func (*Glue) RegisterSaga ¶
RegisterSaga registers the saga instance with the Bus
type Instance ¶
type Instance struct {
ID string
ConcurrencyCtrl int
UnderlyingInstance gbus.Saga
MsgToMethodMap []*MsgToFuncPair
}
Instance represent a living instance of a saga of a particular definition
func NewInstance ¶
func NewInstance(sagaType reflect.Type, msgToMethodMap []*MsgToFuncPair) *Instance
type MsgToFuncPair ¶
type MsgToFuncPair struct {
Filter *gbus.MessageFilter
SagaFuncName string
}
type Store ¶
type Store interface {
RegisterSagaType(saga gbus.Saga)
GetSagaByID(tx *sql.Tx, sagaID string) (*Instance, error)
GetSagasByType(tx *sql.Tx, sagaType reflect.Type) ([]*Instance, error)
SaveNewSaga(tx *sql.Tx, sagaType reflect.Type, newInstance *Instance) error
UpdateSaga(tx *sql.Tx, instance *Instance) error
DeleteSaga(tx *sql.Tx, instance *Instance) error
Purge() error
}
Store abtracts the way sagas get persisted
type TimeoutManager ¶
type TimeoutManager struct {
// contains filtered or unexported fields
}
TimeoutManager manages timeouts for sagas TODO:Make it persistent
func (*TimeoutManager) RequestTimeout ¶
func (tm *TimeoutManager) RequestTimeout(svcName, sagaID string, duration time.Duration)
RequestTimeout requests a timeout from the timeout manager
Click to show internal directories.
Click to hide internal directories.