Skip to content

Commit

Permalink
websrv: Pass Tokio runtime to filters
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Oct 20, 2024
1 parent e2a556c commit 2a29e85
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 156 deletions.
31 changes: 14 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ aoide-websrv-warp-sqlite = { version = "=0.8.0", path = "crates/websrv-warp-sqli
# Commonly used dependencies.
# Also serves for documenting the opionionated selection of third-party crates.
aho-corasick = "1.1.3"
anyhow = "1.0.89"
anyhow = "1.0.90"
bitflags = "2.6.0"
data-encoding = "2.6.0"
derive_more = "1.0.0"
Expand All @@ -52,7 +52,7 @@ log = "0.4.22"
mime = "0.3.17"
regex = "1.11.0"
serde = "1.0.210"
serde_json = "1.0.129"
serde_json = "1.0.132"
static_assertions = "1.1.0"
strum = "0.26.3"
tantivy = "0.22.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/repo-sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ diesel_migrations = { version = "2.2.0", default-features = false, features = [
log.workspace = true
mime.workspace = true
strum = { workspace = true, features = ["derive"] }
unicase = "2.7.0"
unicase = "2.8.0"
url.workspace = true

# Workspace dependencies
Expand Down
8 changes: 6 additions & 2 deletions file-collection-app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ pub struct NoReceiverForEvent;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[must_use]
pub enum ActionResponse {
/// Rejected (and unchanged), i.e. no effect.
/// Rejected without any effect.
///
/// State is unchanged without any side-effects.
Rejected,
/// Rejected but maybe changed.
/// Rejected (but maybe already changed).
///
/// Might have caused a state change or side-effects.
RejectedMaybeChanged,
/// Accepted (and maybe changed).
Accepted,
Expand Down
9 changes: 8 additions & 1 deletion websrv/src/launcher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ impl Launcher {
let join_handle = std::thread::spawn({
let tokio_rt = runtime.handle().clone();
let config = config.clone();
move || tokio_rt.block_on(run(config, runtime_command_rx, current_runtime_state_tx))
move || {
tokio_rt.block_on(run(
&tokio_rt,
config,
runtime_command_rx,
current_runtime_state_tx,
))
}
});

self.state = InternalState::Running {
Expand Down
Loading

0 comments on commit 2a29e85

Please sign in to comment.