wasmcloud-interface-sleepy

Interface definitions for the "jclmnop:sleepy" capability contract. This contract allows actors to sleep for a specified duration, and also to retrieve the current system time on the wasmcloud host.

Useful for implementing rate limits or other time-based functionality.

Example

```rust use wasmcloudinterfacesleepy::SleepySender; use wasmbusrpc::actor::prelude::*; use wasmbusrpc::Timestamp;

async fn sleepfor5_seconds(ctx: &Context) -> RpcResult<()> { let sleepy = SleepySender::new(); sleepy.sleep(ctx, &5).await?; }

async fn sleepuntil5seconds(ctx: &Context) -> RpcResult<()> { let sleepy = SleepySender::new(); let now = sleepy::now(); let fiveseconds = Timestamp::new(now.sec + 5, now.nsec); sleepy.sleepuntil(ctx, &fiveseconds).await?; }

async fn getcurrenttime(ctx: &Context) -> RpcResult { let sleepy = SleepySender::new(); sleepy.now(ctx).await } ```