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

View File

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

View File

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