pubsub

package
v0.0.0-...-f2f6987 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2014 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint interface {
	broker.Endpoint

	// Publish publishes an Event on this particular transport endpoint.
	Publish(event Event) error
}

type Event

type Event interface {
	Kind() []byte
	Seq() []byte
	SetSeq(seq EventSeqNum)

	// For the clients to be able to drop events that are actually their own.
	Publisher() []byte

	// Body returns the raw event object encoded with the configured transport
	// encoding that is the same for all activated transports.
	Body() []byte
}

type EventRecord

type EventRecord struct {
	Kind []byte
	Seq  EventSeqNum
}

type EventSeqNum

type EventSeqNum uint32

type Exchange

type Exchange interface {

	// RegisterEndpoint registers the given endpoint with this handler so that
	// it can start receiving events collected by other PubSub endpoints.
	RegisterEndpoint(ep Endpoint)

	// UnregisterEndpoint removes the given endpoint from the set of endpoints
	// known to this handler. It will automatically stop receiving forwarded events.
	UnregisterEndpoint(ep Endpoint)

	// Publish forwards the Event to all other PubSub transport endpoints.
	// It can of course do more, but this functionality should always be there.
	// It never fails, the errors are supposed to be handled in the endpoints
	// where they happen.
	Publish(event Event)

	// RequestSequenceTable asks the handler to send the current sequence numbers
	// for the given kind prefix to the application that requested it.
	EventSequenceTable(kindPrefix []byte) []*EventRecord
}

Jump to

Keyboard shortcuts

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