Documentation
¶
Overview ¶
Package inproc is hearth's in-process event transport: 1 bus delivers each event to the subscribers of the same process, on the goroutine that published it, and it drops an event that it has already delivered.
The bus keeps the last 1024 ids it delivered, so a relay that publishes an event again after a lost acknowledgement is harmless: the de-duplication is the 1 that the broker's JetStream does with the message's id.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
Bus is an in-process transport: every subscriber of the process, in the order it subscribed.
A handler runs on the goroutine that published, outside the bus's lock, so it may subscribe and publish. It must not block for long: it holds the publisher.
func (*Bus) Publish ¶
Publish implements events.Transport: it delivers the event to each subscriber whose filter takes the event's topic, in the order they subscribed, and it skips an event whose id is among the last 1024 ids the bus delivered.
The context is not read: a subscriber of the process holds the event at once.