Add the default channels as described in RFC 0003

This commit is contained in:
R Tyler Croy 2019-12-30 07:30:06 -08:00
parent 0d11b64a9b
commit 22d273aa97
No known key found for this signature in database
GPG Key ID: E5C92681BEF6CEA2
3 changed files with 23 additions and 11 deletions

View File

@ -8,13 +8,15 @@ heartbeat: 30
#
# NOTE: there is a default "all" channel which is used to broadcast information
# to all clients.
channels:
# Stateful channels where clients may reconnect and pick up where they left
# off in the channel
stateful:
- tasks
- audit
# Stateless channels are those which operate on a "pub/sub" model, if a
# client misses a message, it's gone
stateless:
- all
#
# WARN: Channels are not merged with the default configuration, and will overwrite
# channels:
# stateful:
# - audit
# - tasks.for_auction
# - tasks.auction
# - tasks.bids
# stateless:
# - all
# - tasks.started
# - tasks.finished

View File

@ -7,6 +7,7 @@ extern crate serde_json;
use actix::Message;
use serde::{Deserialize, Serialize};
use serde_json::Value;
pub mod bus;
pub mod client;
@ -35,5 +36,9 @@ pub enum Command {
* The channel the client wishes to unsubscribe from
*/
channel: String,
}
},
Publish {
channel: String,
payload: Value,
},
}

View File

@ -5,5 +5,10 @@ heartbeat: 60
channels:
stateful:
- audit
- tasks.for_auction
- tasks.auction
- tasks.bids
stateless:
- all
- tasks.started
- tasks.finished