switchboard-node-macros

Crates.ioswitchboard-node-macros
lib.rsswitchboard-node-macros
version0.1.0
sourcesrc
created_at2024-01-04 14:49:08.513778
updated_at2024-01-04 14:49:08.513778
descriptionProc macros for using Switchboard
homepagehttps://switchboard.xyz
repository
max_upload_size
id1088704
size18,296
Jackson Jessup (jessupjn)

documentation

README

Switchboard Logo

switchboard-node-macros

Proc macros for using Switchboard

Crates.io Badge

Discord Badge

Twitter Badge

Switchboard Documentation: docs.switchboard.xyz

Install

Run the following Cargo command in your project directory:

cargo add switchboard-node-macros

Or add the following line to your Cargo.toml:

[dependencies]
switchboard-node-macros = "0.1.0"

Usage

You can decorate functions to run them periodically

use switchboard_node_macros::routine;

// Invoke this function every 15 seconds and skip running it on the first tick
#[routine(interval = 15, skip_first_tick)]
async fn some_method(&self, some_channel_tx: &Sender<u8>) -> Result<(), SbError> {
    Ok(())
}
Commit count: 0

cargo fmt