[relay] Wake-up: a push endpoint per mailbox, and a constant wake to it when a blob arrives
ci / check (pull_request) Has been cancelled
ci / check (pull_request) Has been cancelled
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//! `tabellarius-relay [--listen 127.0.0.1:8470] [--db tabellarius-relay.db] [--max-bytes N]
|
||||
//! [--max-mailboxes N] [--max-invites N]`
|
||||
//! [--max-mailboxes N] [--max-invites N] [--push-loopback]`
|
||||
//!
|
||||
//! Prints one line at start (version and address) and nothing per request.
|
||||
|
||||
@@ -8,6 +8,7 @@ use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
||||
use tabellarius_relay::http::{router, AppState, Clock};
|
||||
use tabellarius_relay::parse_args;
|
||||
use tabellarius_relay::store::Store;
|
||||
use tabellarius_relay::wake::Waker;
|
||||
|
||||
fn now() -> i64 {
|
||||
SystemTime::now()
|
||||
@@ -63,7 +64,11 @@ async fn main() {
|
||||
});
|
||||
|
||||
let clock: Clock = Arc::new(now);
|
||||
let app = router(AppState { store, clock });
|
||||
let app = router(AppState::with_waker(
|
||||
store,
|
||||
clock,
|
||||
Waker::new(args.push_loopback),
|
||||
));
|
||||
let shutdown = async {
|
||||
let _ = tokio::signal::ctrl_c().await;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user