Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action interface { // Execute to invoke when a message is received. Return nil to not send a response or return an instance to send in response Execute(event datamodel.ModelReceiveEvent) (datamodel.ModelSendEvent, error) }
Action defines a specific action interface for running an action in response to an event
func NewAction ¶
func NewAction(callback ActionFunc) Action
NewAction is a convenient wrapper that implements the Action interface
type ActionFunc ¶
type ActionFunc func(instance datamodel.ModelReceiveEvent) (datamodel.ModelSendEvent, error)
ActionFunc is a callback function for an action
type ActionSubscription ¶
type ActionSubscription struct {
// contains filtered or unexported fields
}
ActionSubscription is returned to control when the subscription should be closed
func Register ¶
Register an action and return a subscription. You must call Close on the response when you're done (or shutting down)
func (*ActionSubscription) Close ¶
func (s *ActionSubscription) Close() error
Close should be called to stop receiving data from event server
func (*ActionSubscription) WaitForReady ¶
func (s *ActionSubscription) WaitForReady()
WaitForReady will block until the subscription is ack
type Config ¶
type Config struct { // Topic to use when subscribing TODO: Deprecate in favor of Topics Topic string // Factory is a model factory if you need to modify to use a different once Factory ModelFactory event.Subscription }
Config for the action
type ModelFactory ¶
type ModelFactory interface {
New(name datamodel.ModelNameType) datamodel.Model
}
ModelFactory creates new instances of models
Click to show internal directories.
Click to hide internal directories.