-
Notifications
You must be signed in to change notification settings - Fork 5.9k
/
AkkaAppsRedisSubscriberActor.scala
executable file
·47 lines (43 loc) · 1.3 KB
/
AkkaAppsRedisSubscriberActor.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package org.bigbluebutton.endpoint.redis
import org.bigbluebutton.common2.bus.IncomingJsonMessageBus
import org.bigbluebutton.common2.redis.{ RedisConfig, RedisSubscriber, RedisSubscriberProvider }
import akka.actor.ActorSystem
import akka.actor.Props
object AppsRedisSubscriberActor {
def props(
system: ActorSystem,
jsonMsgBus: IncomingJsonMessageBus,
redisConfig: RedisConfig,
channelsToSubscribe: Seq[String],
patternsToSubscribe: Seq[String],
forwardMsgToChannel: String
): Props =
Props(
classOf[AppsRedisSubscriberActor],
system,
jsonMsgBus,
redisConfig,
channelsToSubscribe,
patternsToSubscribe,
forwardMsgToChannel
).withDispatcher("akka.redis-subscriber-worker-dispatcher")
}
class AppsRedisSubscriberActor(
system: ActorSystem,
jsonMsgBus: IncomingJsonMessageBus,
redisConfig: RedisConfig,
channelsToSubscribe: Seq[String],
patternsToSubscribe: Seq[String],
forwardMsgToChannel: String
)
extends RedisSubscriberProvider(
system,
"BbbAppsAkkaSub",
channelsToSubscribe,
patternsToSubscribe,
jsonMsgBus,
redisConfig
) {
addListener(forwardMsgToChannel)
subscribe()
}