File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
// The metadata is a serde_json::Value
6
6
// Please refer to https://docs.rs/serde_json/latest/serde_json/value/fn.from_value.html
7
- // on how to interpret it as an instance of type T, implementing Deserialize.
7
+ // on how to interpret it as an instance of type T, implementing Serialize/Deserialize.
8
+
9
+ // For example, if we want to sends a Zulip message every Friday at 11:30am ET into #t-release
10
+ // with a @T-release meeting! content, we should create some Job like:
11
+ //
12
+ // #[derive(Serialize, Deserialize)]
13
+ // struct ZulipMetadata {
14
+ // pub message: String
15
+ // }
16
+ //
17
+ // let metadata = serde_json::value::to_value(ZulipMetadata {
18
+ // message: "@T-release meeting!".to_string()
19
+ // }).unwrap();
20
+ //
21
+ // Job {
22
+ // name: "send_zulip_message",
23
+ // expected_time: "2022-09-30T11:30:00+10:00",
24
+ // frequency: Some(7),
25
+ // frequency_unit: Some(FrequencyUnit::Days),
26
+ // metadata: metadata
27
+ // }
28
+ //
29
+ // ... and add the corresponding "send_zulip_message" handler.
8
30
9
31
pub async fn handle_job ( name : & String , metadata : & serde_json:: Value ) -> anyhow:: Result < ( ) > {
10
32
match name {
You can’t perform that action at this time.
0 commit comments