Subscribe recipient command stub

This commit is contained in:
Evgeny Poberezkin
2020-05-11 20:51:08 +01:00
parent 6eb75a5bdb
commit 223931bc93

View File

@@ -11,6 +11,7 @@
module Simplex.Messaging.Client where
import ClassyPrelude
import Data.Singletons.TH
import Simplex.Messaging.Protocol
import Simplex.Messaging.Types
@@ -26,8 +27,28 @@ instance Prf HasState Sender s
action = CreateConn
protoAction = rCreateConn
instance ( (r /= None && r /= Disabled) ~ True
, (b /= None && b /= Disabled) ~ True
, Prf HasState Sender s )
=> ProtocolActionOf Recipient
() ()
Recipient Broker
(r <==> b <==| s)
(r <==> b <==| s)
Idle Subscribed n n
where
action = Subscribe
protoAction = rSubscribe
rCreateConn :: Connection Recipient None Idle
-> CreateConnRequest
-> Either String CreateConnResponse
-> Either String (Connection Recipient New Idle)
rCreateConn = protoActionStub
rSubscribe :: Connection Recipient s Idle
-> ()
-> Either String ()
-> Either String (Connection Recipient s Subscribed)
rSubscribe = protoActionStub