pub trait AccelStream:
Send
+ Sync
+ 'static {
type Backend: AccelBackend;
// Required methods
fn record_event(
&self,
) -> Result<<Self::Backend as AccelBackend>::Event, AccelError>;
fn wait_event(
&self,
event: &<Self::Backend as AccelBackend>::Event,
) -> Result<(), AccelError>;
}Expand description
Stream / queue contract: ordered submission of work, plus the ability to record an event for cross-stream synchronization.
Required Associated Types§
type Backend: AccelBackend
Required Methods§
Sourcefn record_event(
&self,
) -> Result<<Self::Backend as AccelBackend>::Event, AccelError>
fn record_event( &self, ) -> Result<<Self::Backend as AccelBackend>::Event, AccelError>
Record an event into this stream. Other streams can wait on
the resulting handle via AccelStream::wait_event.
Sourcefn wait_event(
&self,
event: &<Self::Backend as AccelBackend>::Event,
) -> Result<(), AccelError>
fn wait_event( &self, event: &<Self::Backend as AccelBackend>::Event, ) -> Result<(), AccelError>
Wait on an event recorded into another stream before scheduling further work on this one. Backends without cross-queue events synthesize a host-side block.