bitcoin-atm
bitcoin atm for pyc inc.
git clone https://9o.is/git/bitcoin-atm.git
Bus.scala
(854B)
1 package inc.pyc.chimera
2
3 import inc.pyc.lift_akka._
4
5 /**
6 * Main Chimera PubSub used to communicate with client comets.
7 */
8 class LookupSystem extends LiftActorEventBus with PublishHelper {
9 override protected def mapSize: Int = 10
10 }
11
12 /**
13 * Bus in-built functions to make it easier to publish events.
14 */
15 sealed trait PublishHelper {
16 this: LiftActorEventBus =>
17
18 def updateState[T >: State](state: T) =
19 publish(EventUpdate(Topic.stateUpdate, state))
20
21 def updateData[T >: Data](data: T) =
22 publish(EventUpdate(Topic.dataUpdate, data))
23
24 def updatePrice(price: String) =
25 publish(EventUpdate(Topic.priceUpdate, price))
26
27 def updateConfig(config: SystemConfig) =
28 publish(EventUpdate(Topic.configUpdate, config))
29
30 def updateSession(any: Any) =
31 publish(EventUpdate(Topic.sessionUpdate, any))
32 }