Python node API #49
haixuanTao
started this conversation in
Done
Replies: 1 comment 1 reply
-
With philipp, we discussed the possibility of using decorators for looping forever a node as such: from dora import dora_loop
@dora_loop(params...)
def function(input: DoraInput):
return output # Dict[string, Bytes] async fn dora_loop(function) {
let session = Session::new();
while True:
let dora_input = session.next().await; # DoraInput
let outputs = spawn_blocking(|_| { function(dora_input) }).await;
for (topic, output) in outputs {
send_output(topic, output).await
}
// Can Return a handle and detach the process
} But, it felt like it would be too close to the Python Operator API and so we chose not to include it in the Python Node API |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Python Node proposal
Dora node Python
After discussing with Philipp, we agreed on implementing a "oneshot" Python node function that reflects the Rust Node API. The idea is to let full control of the user.
Beta Was this translation helpful? Give feedback.
All reactions