realtime

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package realtime provides soft real-time primitives: fixed-timestep loop generators, timing wheels, and lock-free topics.

Index

Constants

View Source
const ID = "realtime"

Variables

View Source
var TopicKey = xctx.NewKey[interface{ Publish(any) }]("realtime.topic")

TopicKey provides the lock-free broadcast channel for the current room.

View Source
var WheelKey = xctx.NewKey[*timing.Wheel]("realtime.wheel")

WheelKey provides the game loop's timing wheel.

Functions

func Bundle

func Bundle(_ map[string]string) core.Bundle

func Library

func Library() action.Library

func TickerSource

func TickerSource() action.AnyStreamAction

TickerSource wraps the kernel's fixed-timestep stream.

func TopicPublishAction

func TopicPublishAction() action.AnyAction

func WheelAdvanceAction

func WheelAdvanceAction() action.AnyAction

func WheelCancelAction

func WheelCancelAction() action.AnyAction

func WheelScheduleAction

func WheelScheduleAction() action.AnyAction

Types

type TicksReq

type TicksReq struct {
	Hz           int `json:"hz"`
	MaxCatchupMs int `json:"max_catchup_ms"`
}

type WheelScheduleReq

type WheelScheduleReq struct {
	DelayMs int64 `json:"delay_ms"`
	Payload any   `json:"payload"`
}

type WheelScheduleRes

type WheelScheduleRes struct {
	TimerID uint64 `json:"timer_id"`
}

Jump to

Keyboard shortcuts

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