diff options
Diffstat (limited to 'plugins/broadcast/websockets/rpc.go')
-rw-r--r-- | plugins/broadcast/websockets/rpc.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/broadcast/websockets/rpc.go b/plugins/broadcast/websockets/rpc.go new file mode 100644 index 00000000..1c62b902 --- /dev/null +++ b/plugins/broadcast/websockets/rpc.go @@ -0,0 +1,17 @@ +package websockets + +type rpcService struct { + svc *Service +} + +// Subscribe subscribes broadcast client to the given topic ahead of any websocket connections. +func (r *rpcService) Subscribe(topic string, ok *bool) error { + *ok = true + return r.svc.client.Subscribe(topic) +} + +// SubscribePattern subscribes broadcast client to +func (r *rpcService) SubscribePattern(pattern string, ok *bool) error { + *ok = true + return r.svc.client.SubscribePattern(pattern) +} |