mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-14 03:07:57 +01:00
Make Actuator trait non-async
This commit is contained in:
parent
173ef6d055
commit
e0c1ce868d
@ -49,9 +49,8 @@ impl Shelly {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
impl Actuator for Shelly {
|
impl Actuator for Shelly {
|
||||||
async fn subscribe(&mut self, signal: StatusSignal) {
|
fn subscribe(&mut self, signal: StatusSignal) {
|
||||||
self.signal.replace(signal);
|
self.signal.replace(signal);
|
||||||
if let Some(waker) = self.waker.take() {
|
if let Some(waker) = self.waker.take() {
|
||||||
waker.wake();
|
waker.wake();
|
||||||
|
@ -38,9 +38,8 @@ impl Actuators {
|
|||||||
|
|
||||||
pub type StatusSignal = Pin<Box<dyn Signal<Item = Status> + Send + Sync>>;
|
pub type StatusSignal = Pin<Box<dyn Signal<Item = Status> + Send + Sync>>;
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
pub trait Actuator: Stream<Item = future::BoxFuture<'static, ()>> {
|
pub trait Actuator: Stream<Item = future::BoxFuture<'static, ()>> {
|
||||||
async fn subscribe(&mut self, signal: StatusSignal);
|
fn subscribe(&mut self, signal: StatusSignal);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is merely a proof that Actuator *can* be implemented on a finite, known type. Yay for type
|
// This is merely a proof that Actuator *can* be implemented on a finite, known type. Yay for type
|
||||||
@ -49,9 +48,9 @@ struct Dummy {
|
|||||||
log: Logger,
|
log: Logger,
|
||||||
signal: Option<StatusSignal>
|
signal: Option<StatusSignal>
|
||||||
}
|
}
|
||||||
#[async_trait]
|
|
||||||
impl Actuator for Dummy {
|
impl Actuator for Dummy {
|
||||||
async fn subscribe(&mut self, signal: StatusSignal) {
|
fn subscribe(&mut self, signal: StatusSignal) {
|
||||||
self.signal.replace(signal);
|
self.signal.replace(signal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user