Browse Source

Make coordinator's `start_inner` function `Send` again

The name generator uses a thread-local random number generator internally, which makes it `!Send`. So we should not keep it across await points because our `multiple_daemons` example needs to spawn it in the tokio runtime, which requires `Send`.
tags/v0.2.3^2
Philipp Oppermann haixuanTao 3 years ago
parent
commit
e46ea2f6f6
1 changed files with 1 additions and 3 deletions
  1. +1
    -3
      binaries/coordinator/src/lib.rs

+ 1
- 3
binaries/coordinator/src/lib.rs View File

@@ -159,8 +159,6 @@ async fn start_inner(
let mut archived_dataflows: HashMap<Uuid, ArchivedDataflow> = HashMap::new();
let mut daemon_connections: HashMap<_, DaemonConnection> = HashMap::new();

let mut name_generator = names::Generator::default();

while let Some(event) = events.next().await {
if event.log() {
tracing::trace!("Handling event {event:?}");
@@ -305,7 +303,7 @@ async fn start_inner(
name,
local_working_dir,
} => {
let name = name.or_else(|| name_generator.next());
let name = name.or_else(|| names::Generator::default().next());

let inner = async {
if let Some(name) = name.as_deref() {


Loading…
Cancel
Save