Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartChildProcess ¶
func StartChildProcess(url string)
Types ¶
type Library ¶
type Library struct {
// contains filtered or unexported fields
}
func New ¶
func New(subscriptionId string, adapter PushAdapter) *Library
func (*Library) AttachPushHandler ¶
attach to receive Pusher's pushes at a defined path, example: "/_eventhorizon_push"
type PushAdapter ¶
type PushAdapter interface { // PushWrapTransaction() is an API that pushlib calls to wrap all // following operations in a single transaction. we: // // 1) start transaction // 2) call back to pushlib with "run" with the transaction, after which pusher calls: // - PushGetOffset() // - PushHandleEvent() multiple times // - PushSetOffset() // 3) app gets back error state from "run" callback indicating if anything went // wrong. if we get error back we must rollback the transaction, otherwise commit. PushWrapTransaction(run func(tx interface{}) error) error PushGetOffset(stream string, tx interface{}) (string, error) PushSetOffset(stream string, offset string, tx interface{}) error PushHandleEvent(line *rtypes.ReadResultLine, tx interface{}) error }
Sequence of events, success: ----------------------------
PushWrapTransaction
PushGetOffset PushHandleEvent PushHandleEvent PushHandleEvent PushSetOffset
Sequence of events, failure: ----------------------------
PushWrapTransaction
PushGetOffset PushHandleEvent => error => stop
Click to show internal directories.
Click to hide internal directories.