Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From ump-server-0.4.0 To trunk
2024-10-07
| ||
02:13 | Allow handler builders to return an application-defined context. check-in: 2991f2a6fa user: jan tags: builder-context | |
2024-09-26
| ||
11:29 | Enable all features for clippy jobs in bacon.toml. Leaf check-in: ad972bd452 user: jan tags: trunk | |
11:25 | Move clippy settings to Cargo.toml. check-in: 72b03a9f48 user: jan tags: trunk | |
2024-09-10
| ||
18:09 | Hardcode all features for pedantic clippy in bacon config. check-in: 09c247864d user: jan tags: trunk | |
01:14 | Release maintenance. check-in: ea36f2935c user: jan tags: trunk, ump-server-0.4.0 | |
01:09 | Update ump to 0.13.0. clippy fixes. check-in: 9cea401a86 user: jan tags: trunk | |
Changes to Cargo.toml.
︙ | |||
20 21 22 23 24 25 26 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | - + + + + + + + | [features] default = ["tokio"] tokio = ["dep:tokio", "dep:async-trait"] tracing = ["dep:tracing"] watchdog = ["dep:parking_lot"] [dependencies] |
Changes to bacon.toml.
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | - + + - + - - - - - - - - - - - - - - - - - - - - - - - - | # This is a configuration file for the bacon tool # # Bacon repository: https://github.com/Canop/bacon # Complete help on configuration: https://dystroy.org/bacon/config/ # You can also check bacon's own bacon.toml file # as an example: https://github.com/Canop/bacon/blob/main/bacon.toml # For information about clippy lints, see: # https://github.com/rust-lang/rust-clippy/blob/master/README.md #default_job = "check" |
︙ |
Changes to src/lib.rs.
︙ | |||
42 43 44 45 46 47 48 49 50 51 52 53 54 55 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | + + + + + + + + + + + + + | //! has been created so it can be passed a reference to the client end-point. //! //! If the dispatch loop should terminate once all the application's client //! end-points have been dropped, then the handler can store a [`WeakClient`] //! instead (as storing a cloned [`Client`] object will preventing the dispatch //! loop from terminating due to all clients being lost). The examples in the //! [`task`] and [`thread`] modules illustrate how to do this. //! //! ## Generics //! When a new handler is created, it needs to define the generic type //! parameters: //! //! - `S` - sent from the client to the server handler when making requests. //! - `R` - replies sent back to the client from the server handler using. //! [`ReplyContext::reply()`]. //! - `E` - errors returned from server handler to requestor through //! [`ReplyContext::fail()`] (and also returned by the server handler //! construction closure). //! - `RV` - return type the server handler can use to pass termination data //! back to the dispatch loop creator once it terminates. #![cfg_attr(docsrs, feature(doc_cfg))] #[cfg(feature = "watchdog")] mod wdog; #[cfg(feature = "tokio")] |
︙ |
Changes to src/task.rs.
︙ | |||
63 64 65 66 67 68 69 70 71 72 73 74 75 76 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | + + + | use tokio::task::{self, JoinHandle}; use async_trait::async_trait; use super::{channel, Client, ReplyContext}; /// Message processing trait for an async handler. /// /// See top module documentation for more information about [application /// message handlers](crate#application-message-handlers). #[async_trait] pub trait Handler<S, R, E, RV> { /// Optional initialization callback. /// /// This is called on the dispatcher task before the main message dispatch /// loop is entered. #[allow(unused_variables)] |
︙ | |||
105 106 107 108 109 110 111 112 113 | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | + + - + + | fn term(&mut self, rv: Option<RV>) -> Option<RV> { rv } } /// Run a task which will process incoming messages from an ump server /// end-point. /// /// `hbldr` is a closure that should spawn a [`Handler`]. /// /// See top module's documentation for an overview of the [dispatch |
︙ |
Changes to src/thread.rs.
︙ | |||
55 56 57 58 59 60 61 62 63 64 65 66 67 68 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | + + + | //! ``` use std::{ops::ControlFlow, thread}; use super::{channel, Client, ReplyContext}; /// Message processing trait for a threaded handler. /// /// See top module documentation for more information about [application /// message handlers](crate#application-message-handlers). pub trait Handler<S, R, E, RV> { /// Optional initialization callback. /// /// This is called on the dispatcher thread before the main message /// dispatch loop is entered. #[allow(unused_variables)] fn init(&mut self, weak_client: ump::WeakClient<S, R, E>) {} |
︙ | |||
96 97 98 99 100 101 102 103 104 | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | + + - + + | fn term(&mut self, rv: Option<RV>) -> Option<RV> { rv } } /// Run a thread which will process incoming messages from an ump server /// end-point. /// /// `hbldr` is a closure that should spawn a [`Handler`]. /// /// See top module's documentation for an overview of the [dispatch |
︙ |