Documentation
¶
Overview ¶
Package event defines canonical descriptors for typed application events.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventListenerHandler ¶
EventListenerHandler contributes one ordered typed event listener.
func EventTopicHandler ¶
EventTopicHandler contributes a typed event topic provider.
func Listener ¶
func Listener() sdk.Definition
Listener marks a provider-owned method as a typed event listener.
Spice matches the method payload to an exact topic payload type and orders listeners by order, module, and symbol identity. The generated invocation propagates context and errors without a global event bus.
// @import { Listener } from "github.com/spice-framework/spice/annotation/event"
// @Listener(order=10)
func Topic ¶
func Topic() sdk.Definition
Topic marks an event payload type as one typed event topic.
The payload's exact type identity and ownership come from its Go declaration and application module. Spice contributes a synthetic event.Publisher[T] provider. Generated publishing remains explicit and observable.
// @import { Topic } from "github.com/spice-framework/spice/annotation/event"
// @Topic
type OrderChanged struct {
OrderID string
}
Package-level function topics remain temporarily accepted for pre-0.2 migration. New applications should annotate the payload type.
Types ¶
This section is empty.