refactor: store timeout in receiver, separate event/run senders
Add new NotificationChannel constructors, for different kinds of channels. Store the receive timeout in the receiver; it depends on kind of channel.
Also add methods to send and receive notifications to senders and receivers. This hides the std::sync::mpsc machinery better, and makes the types easier to use.
Signed-off-by: Lars Wirzenius liw@liw.fi
feat: notify page generation about changes to runs more often
Change src/adapter.rs to send notification via the run notification channel when the adapter is spawned, and when the adapter sends a “triggered” message.
Signed-off-by: Lars Wirzenius liw@liw.fi
8 files changed
+145
-44
d537fd39
→
0f90e97a
modified src/adapter.rs
@@ -19,6 +19,7 @@ use crate::{
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -50,11 +51,17 @@ impl Adapter {
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -62,7 +69,13 @@ impl Adapter {
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -74,6 +87,8 @@ impl Adapter {
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -93,6 +108,7 @@ impl Adapter {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -111,6 +127,7 @@ impl Adapter {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -208,6 +225,10 @@ pub enum AdapterError {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -223,6 +244,7 @@ mod test {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -260,7 +282,9 @@ echo '{"response":"finished","result":"success"}'
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -280,7 +304,9 @@ echo '{"response":"finished","result":"failure"}'
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -307,7 +333,9 @@ exit 1
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -327,7 +355,9 @@ kill -9 $BASHPID
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -351,7 +381,9 @@ kill -9 $BASHPID
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -373,7 +405,9 @@ kill -9 $BASHPID
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -394,7 +428,9 @@ echo '{"response":"finished","result":"success","bad":"field"}'
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -417,7 +453,9 @@ echo '{"response":"finished","result":"success"}'
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -444,7 +482,9 @@ echo '{"response":"finished","result":"success"}'
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -463,7 +503,9 @@ echo '{"response":"finished","result":"success"}'
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -490,7 +532,9 @@ echo '{"response":"finished","result":"success"}'
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -521,7 +565,9 @@ echo '{"response":"finished","result":"success"}'
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified src/bin/cib.rs
@@ -125,7 +125,7 @@ struct InsertCmd {}
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -161,14 +161,14 @@ impl QueuedCmd {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -209,8 +209,8 @@ struct ProcessEventsCmd {}
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
modified src/bin/cibtoolcmd/report.rs
@@ -20,7 +20,7 @@ impl Leaf for ReportCmd {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified src/broker.rs
@@ -17,6 +17,7 @@ use crate::{
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -64,7 +65,11 @@ impl Broker {
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -102,7 +107,7 @@ impl Broker {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -173,6 +178,7 @@ mod test {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -283,7 +289,9 @@ echo '{"response":"finished","result":"success"}'
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -314,7 +322,9 @@ exit 1
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified src/notif.rs
@@ -1,12 +1,46 @@
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -22,12 +56,22 @@ pub struct NotificationChannel {
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -53,4 +97,7 @@ pub enum NotificationError {
|
|
|
|
|
|
| + | |
| + | |
| + | |
|
modified src/pages.rs
@@ -545,7 +545,7 @@ impl StatusPage {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified src/queueadd.rs
@@ -93,7 +93,7 @@ impl QueueAdder {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified src/queueproc.rs
@@ -5,7 +5,6 @@
|
|
|
|
|
|
| - | |
|
|
|
|
|
@@ -19,8 +18,6 @@ use crate::{
|
|
|
|
|
|
| - | |
| - | |
|
|
|
|
|
@@ -79,12 +76,13 @@ impl QueueProcessor {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
|
@@ -136,7 +134,7 @@ impl QueueProcessor {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -154,7 +152,7 @@ impl QueueProcessor {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -186,8 +184,8 @@ pub enum QueueError {
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|