event

package
v0.1.0-preview.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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

func EventListenerHandler(
	_ context.Context,
	invocation sdk.Invocation,
) (sdk.Result, error)

EventListenerHandler contributes one ordered typed event listener.

func EventTopicHandler

func EventTopicHandler(
	_ context.Context,
	invocation sdk.Invocation,
) (sdk.Result, error)

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 a provider function that declares one typed event topic.

The topic's exact payload type and ownership come from the Go signature and application module. Generated publishing remains explicit and observable.

// @import { Topic } from "github.com/spice-framework/spice/annotation/event"
// @Topic
func OrderChangedTopic() event.Topic[OrderChanged]

Types

This section is empty.

Jump to

Keyboard shortcuts

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