switchboard-node-macros 0.1.0

Proc macros for using Switchboard
Documentation
<div align="center">

![Switchboard Logo](https://github.com/switchboard-xyz/switchboard/raw/main/website/static/img/icons/switchboard/avatar.png)

# switchboard-node-macros

> Proc macros for using Switchboard

[![Crates.io Badge](https://img.shields.io/crates/v/switchboard-solana?label=switchboard-solana-macros&logo=rust)](https://crates.io/crates/switchboard-solana-macros)

[![Discord Badge](https://img.shields.io/discord/841525135311634443?color=blueviolet&logo=discord&logoColor=white)](https://discord.gg/switchboardxyz)

[![Twitter Badge](https://img.shields.io/twitter/follow/switchboardxyz?label=Follow+Switchboard)](https://twitter.com/switchboardxyz)

  <h4>
    <strong>Switchboard Documentation: </strong><a href="https://docs.switchboard.xyz">docs.switchboard.xyz</a>
  </h4>
</div>

## Install

Run the following Cargo command in your project directory:

```bash
cargo add switchboard-node-macros
```

Or add the following line to your Cargo.toml:

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

## Usage

You can decorate functions to run them periodically

```rust
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(())
}
```