event

package
v0.1.0-preview.4 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 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 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.

Jump to

Keyboard shortcuts

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