Status Update: 2022-06-08 #28
Replies: 4 comments
-
Coordinator and Runtime Implementation
dora-coordinator run pylot.yaml
dora-coordinator visualize pylot.yaml
use dora_node_api::{self, config::DataId, DoraNode};
#[tokio::main]
async fn main() -> eyre::Result<()> {
let node = DoraNode::init_from_env().await?;
let mut inputs = node.inputs().await?;
let output = DataId::from("number".to_owned());
let duration = Duration::from_secs(3);
loop {
let input = match timeout(duration, inputs.next()).await {
Ok(Some(input)) => input,
Ok(None) => break,
Err(_) => bail!("timeout while waiting for input"),
};
match input.id.as_str() {
"timestamp" => {
let random: u64 = random();
node.send_output(&output, &random.to_le_bytes()).await?;
}
other => eprintln!("Ignoring unexpected input `{other}`"),
}
}
Ok(())
}
use dora_operator_api::{register_operator, DoraOperator, DoraOutputSender};
register_operator!(ExampleOperator);
#[derive(Debug, Default)]
struct ExampleOperator {
time: Option<String>,
}
impl DoraOperator for ExampleOperator {
fn on_input(
&mut self,
id: &str,
data: &[u8],
output_sender: &mut DoraOutputSender,
) -> Result<(), ()> {
match id {
"time" => {
let parsed = std::str::from_utf8(data).map_err(|_| ())?;
self.time = Some(parsed.to_owned());
}
other => eprintln!("ignoring unexpected input {other}"),
}
Ok(())
}
}
|
Beta Was this translation helpful? Give feedback.
-
Communication Layer
#[async_trait]
pub trait CommunicationLayer {
async fn subscribe<'a>(
&'a self,
topic: &str,
) -> Result<Pin<Box<dyn futures::Stream<Item = Vec<u8>> + 'a>>, BoxError>;
async fn publish(&self, topic: &str, data: &[u8]) -> Result<(), BoxError>;
fn publish_sync(&self, topic: &str, data: &[u8]) -> Result<(), BoxError>;
async fn close(self: Box<Self>) -> Result<(), BoxError>;
}
communication:
zenoh:
prefix: /foo
|
Beta Was this translation helpful? Give feedback.
-
Connecting the coordinator and runtime implementation with Pylot
|
Beta Was this translation helpful? Give feedback.
-
Modus Operandi of Releasing Dora?
Open Atom First Contest on Open Source Software?Brainstom the Scope, Compete, Organise, tools Contest. The competition happens at the fall end of the year. If Dora is ok in Q3, the incentive to push contribution. Follow up action: Objectives:
Open Atom Contest on Algorithm?More research-centric contest on validation of algorithm ( Software Research ) |
Beta Was this translation helpful? Give feedback.
-
In this discussion, we describe our recent progress and the main topics that we would like to discuss in today's meeting. We use a separate post for each topic to keep the discussion focused. Feel free to create new posts for topics that are not mentioned yet.
Beta Was this translation helpful? Give feedback.
All reactions