Skip to main content

Crate lingxia_messaging

Crate lingxia_messaging 

Source
Expand description

LingXia Messaging System

Provides two core functionalities for cross-platform communication:

  1. A flexible callback registry that supports oneshot, stream, and handler callbacks.
  2. A publish-subscribe system for system-wide events.

Structs§

Event
Represents a system-wide event.

Enums§

CallbackResult
Callback result from platform

Functions§

get_callback
Register a oneshot callback and get its receiver.
get_stream_callback
Register a stream callback and get its receiver.
invoke_callback
Invoke callback (called from platform code) to send result back.
publish
Publish an event to all subscribers.
register_handler
Register a handler callback. The handler is executed immediately on the thread that calls invoke_callback with the returned ID. Use remove_callback(id) to unregister when no longer needed.
remove_callback
Remove callback by ID. This is useful for cancellation or timeout scenarios.
subscribe
Subscribe to a named event.