Skip to main content
QAROS Rust API Dev (main) · versions: Dev (main) · Developer Guide

channel

Function channel 

Source
pub fn channel<Event: Send + 'static>() -> (impl Fn(Event) + Send + Sync + 'static, Receiver<Event>)
Expand description

A callback that forwards events into a channel, and the receiving end.

let (forward, requests) = qaros::channel();
let _subscription = session.subscribe_render_requests(forward)?;
let first_request = requests.recv();