Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From ump-server-0.2.0 To ump-server-0.2.1
2024-02-20
| ||
11:58 | Changelog fixup. check-in: b99bf2d8a9 user: jan tags: trunk | |
11:50 | Release maintenance. check-in: 933f121ec8 user: jan tags: trunk, ump-server-0.2.1 | |
08:06 | Up version. check-in: 157c1acc22 user: jan tags: trunk | |
2024-01-28
| ||
14:28 | Update doc examples to store a weak client reference within the handler. check-in: 3ea6f918b0 user: jan tags: trunk | |
13:39 | Release maintenance. check-in: 88c41e1742 user: jan tags: trunk, ump-server-0.2.0 | |
13:26 | Make the spawm methods take in a closure for constructing the handler, to allow the handler to be created after the channel client. Add thread/task examples to module docs. check-in: 752b1bbc09 user: jan tags: trunk | |
Changes to .efiles.
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 | + + | Cargo.toml README.md www/index.md www/changelog.md src/lib.rs src/thread.rs src/task.rs src/wdog.rs tests/term.rs tests/common/mod.rs examples/wdog_timeout.rs |
Changes to Cargo.toml.
1 2 | 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 | - + + + + - + + | [package] name = "ump-server" |
Added examples/wdog_timeout.rs.
|
Changes to src/lib.rs.
︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | 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 57 58 59 60 | + + + + + + + + + + + + + + + + | //! - The message queue is empty and all the associated [`Client`]s have been //! released. This would cause the thread to return `None`. //! //! # Application message handlers //! Message handlers are implemented using the [`thread::Handler`] trait (for //! the threaded dispatch loop) and [`task::Handler`] (for the async dispatch //! loop). //! //! There are cases where the handler needs to store a clone of the client //! end-point of the message passing channel used to issue requests to the //! server (so that message handlers can issue new requests). In order to //! facilitate this, the application must pass a `Handler`-construction closure //! to `spawn()`. The closure will be called after the message passing channel //! 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. #![cfg_attr(docsrs, feature(doc_cfg))] #[cfg(feature = "watchdog")] mod wdog; #[cfg(feature = "tokio")] #[cfg_attr(docsrs, doc(cfg(feature = "tokio")))] pub mod task; pub mod thread; |
︙ |
Changes to src/task.rs.
1 2 3 4 5 6 7 8 | 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 | + - + + + + - + + + + + + + - - + + | //! ump server running in an async task. //! //! # Example //! ``` //! # tokio_test::block_on(async { //! use std::ops::ControlFlow; //! use ump_server::{ //! async_trait, //! task::{Handler, spawn}, |
︙ | |||
98 99 100 101 102 103 104 105 | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | + - - + + - + + + + + + + + - + + + + + + + + + + - + | } /// Run a task which will process incoming messages from an ump server /// end-point. /// /// See top module's documentation for an overview of the [dispatch /// loop](crate#dispatch-loop). #[allow(clippy::type_complexity)] pub fn spawn<S, R, E, RV, F>( |
Changes to src/thread.rs.
1 2 3 4 5 6 | 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 | + - + + + + - + + + + + + + - - + + | //! ump server running on a thread. //! //! # Example //! ``` //! use std::ops::ControlFlow; //! use ump_server::{ //! thread::{Handler, spawn}, |
︙ | |||
89 90 91 92 93 94 95 96 | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | + - - + + - + + + + + + + + - + + + + + + + + + + - + | } /// Run a thread which will process incoming messages from an ump server /// end-point. /// /// See top module's documentation for an overview of the [dispatch /// loop](crate#dispatch-loop). #[allow(clippy::type_complexity)] pub fn spawn<S, R, E, RV, F>( |
Added src/wdog.rs.