radicle_ci_broker::notif

Struct NotificationChannel

Source
pub struct NotificationChannel { /* private fields */ }
Expand description

Notification channel.

The notification channel allows one thread to notify another that the other thread has some work to do. The notification carries no other information: the receiver is supposed to know where it can get whatever data it needs to what it needs to do.

The point of this is to make sure threads in the CI broker exchange data only via the database, where it is persistent.

Implementations§

Source§

impl NotificationChannel

Source

pub fn new_event() -> Self

Construct a channel for notifying about new events.

Source

pub fn new_run() -> Self

Construct a channel for notifying about new CI runs.

Source§

impl NotificationChannel

Source

pub fn tx(&mut self) -> Result<NotificationSender, NotificationError>

Return the transmit endpoint of the notification channel. This can only be called once.

Source

pub fn rx(&mut self) -> Result<NotificationReceiver, NotificationError>

Return the receive endpoint of the notification channel. This can only be called once.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T