Skip to main content

Module server_plugin

Module server_plugin 

Source
Expand description

ServerPlugin helper trait for the common case: a plugin that runs one long-lived background task (HTTP server, queue consumer, etc.) and shuts down when the server signals shutdown.

Most plugins should implement ServerPlugin rather than Plugin directly, then wrap with ServerPluginWrapper.

Structs§

ServerPluginWrapper
Wraps a ServerPlugin so it can be used as a Plugin. Spawns run at boot, awaits the task during shutdown.

Traits§

ServerPlugin
Trait for plugins that run a single long-lived background task. The run future should observe ctx.shutdown and return when signaled.