@@ -38,8 +38,8 @@ import Ouroboros.Network.Protocol.ObjectDiffusion.Type
38
38
--
39
39
-- The peer in the outbound role submits objects to the peer in the server
40
40
-- role.
41
- newtype ObjectDiffusionOutbound txid tx m a = ObjectDiffusionOutbound
42
- { runObjectDiffusionOutbound :: m (OutboundStIdle txid tx m a )
41
+ newtype ObjectDiffusionOutbound objectId object m a = ObjectDiffusionOutbound
42
+ { runObjectDiffusionOutbound :: m (OutboundStIdle objectId object m a )
43
43
}
44
44
45
45
-- | In the 'StIdle' protocol state, the outbound does not have agency. Instead
@@ -50,84 +50,84 @@ newtype ObjectDiffusionOutbound txid tx m a = ObjectDiffusionOutbound
50
50
-- * a termination message
51
51
--
52
52
-- It must be prepared to handle any of these.
53
- data OutboundStIdle txid tx m a = OutboundStIdle
53
+ data OutboundStIdle objectId object m a = OutboundStIdle
54
54
{ recvMsgRequestObjectIds ::
55
55
forall blocking .
56
56
SingBlockingStyle blocking ->
57
57
NumObjectIdsToAck ->
58
58
NumObjectIdsToReq ->
59
- m (OutboundStObjectIds blocking txid tx m a ),
59
+ m (OutboundStObjectIds blocking objectId object m a ),
60
60
recvMsgRequestObjects ::
61
- [txid ] ->
62
- m (OutboundStObjects txid tx m a )
61
+ [objectId ] ->
62
+ m (OutboundStObjects objectId object m a )
63
63
}
64
64
65
- data OutboundStObjectIds blocking txid tx m a where
65
+ data OutboundStObjectIds blocking objectId object m a where
66
66
SendMsgReplyObjectIds ::
67
- BlockingReplyList blocking (txid , SizeInBytes ) ->
68
- OutboundStIdle txid tx m a ->
69
- OutboundStObjectIds blocking txid tx m a
67
+ BlockingReplyList blocking (objectId , SizeInBytes ) ->
68
+ OutboundStIdle objectId object m a ->
69
+ OutboundStObjectIds blocking objectId object m a
70
70
-- | In the blocking case, the outbound can terminate the protocol. This could
71
71
-- be used when the outbound knows there will be no more objects to submit.
72
- SendMsgDone :: a -> OutboundStObjectIds StBlocking txid tx m a
72
+ SendMsgDone :: a -> OutboundStObjectIds StBlocking objectId object m a
73
73
74
- data OutboundStObjects txid tx m a where
74
+ data OutboundStObjects objectId object m a where
75
75
SendMsgReplyObjects ::
76
- [tx ] ->
77
- OutboundStIdle txid tx m a ->
78
- OutboundStObjects txid tx m a
76
+ [object ] ->
77
+ OutboundStIdle objectId object m a ->
78
+ OutboundStObjects objectId object m a
79
79
80
80
outboundRun ::
81
- forall (initAgency :: Agency ) txid tx m a .
81
+ forall (initAgency :: Agency ) objectId object m a .
82
82
(Monad m ) =>
83
- OutboundStIdle txid tx m a ->
84
- Peer (ObjectDiffusion initAgency txid tx ) AsOutbound NonPipelined StIdle m a
83
+ OutboundStIdle objectId object m a ->
84
+ Peer (ObjectDiffusion initAgency objectId object ) AsOutbound NonPipelined StIdle m a
85
85
outboundRun OutboundStIdle {recvMsgRequestObjectIds, recvMsgRequestObjects} =
86
86
Await ReflInboundAgency $ \ msg -> case msg of
87
87
MsgRequestObjectIds blocking ackNo reqNo -> Effect $ do
88
88
reply <- recvMsgRequestObjectIds blocking ackNo reqNo
89
89
case reply of
90
- SendMsgReplyObjectIds txids k ->
90
+ SendMsgReplyObjectIds objectIds k ->
91
91
-- TODO: investigate why GHC cannot infer `SingI`; it used to in
92
92
-- `coot/typed-protocols-rewrite` branch
93
93
return $ case blocking of
94
94
SingBlocking ->
95
95
Yield ReflOutboundAgency
96
- (MsgReplyObjectIds txids )
96
+ (MsgReplyObjectIds objectIds )
97
97
(outboundRun k)
98
98
SingNonBlocking ->
99
99
Yield ReflOutboundAgency
100
- (MsgReplyObjectIds txids )
100
+ (MsgReplyObjectIds objectIds )
101
101
(outboundRun k)
102
102
SendMsgDone result ->
103
103
return $
104
104
Yield ReflOutboundAgency
105
105
MsgDone
106
106
(Done ReflNobodyAgency result)
107
- MsgRequestObjects txids -> Effect $ do
108
- SendMsgReplyObjects txs k <- recvMsgRequestObjects txids
107
+ MsgRequestObjects objectIds -> Effect $ do
108
+ SendMsgReplyObjects objects k <- recvMsgRequestObjects objectIds
109
109
return $
110
110
Yield ReflOutboundAgency
111
- (MsgReplyObjects txs )
111
+ (MsgReplyObjects objects )
112
112
(outboundRun k)
113
113
114
114
-- | A non-pipelined 'Peer' representing the 'ObjectDiffusionOutbound'.
115
115
objectDiffusionOutboundServerPeer ::
116
- forall txid tx m a .
116
+ forall objectId object m a .
117
117
(Monad m ) =>
118
- ObjectDiffusionOutbound txid tx m a ->
119
- Peer (ObjectDiffusion InboundAgency txid tx ) AsOutbound NonPipelined StInit m a
118
+ ObjectDiffusionOutbound objectId object m a ->
119
+ Peer (ObjectDiffusion InboundAgency objectId object ) AsOutbound NonPipelined StInit m a
120
120
objectDiffusionOutboundServerPeer (ObjectDiffusionOutbound outboundSt) =
121
121
-- We need to assist GHC to infer the existentially quantified `c` as
122
122
-- `Collect objectId object`
123
123
Await ReflInboundAgency
124
124
(\ MsgInit -> Effect (outboundRun <$> outboundSt))
125
125
126
126
objectDiffusionOutboundClientPeer ::
127
- forall txid tx m a .
127
+ forall objectId object m a .
128
128
(Monad m ) =>
129
- ObjectDiffusionOutbound txid tx m a ->
130
- Peer (ObjectDiffusion OutboundAgency txid tx ) AsOutbound NonPipelined StInit m a
129
+ ObjectDiffusionOutbound objectId object m a ->
130
+ Peer (ObjectDiffusion OutboundAgency objectId object ) AsOutbound NonPipelined StInit m a
131
131
objectDiffusionOutboundClientPeer (ObjectDiffusionOutbound outboundSt) =
132
132
Yield ReflOutboundAgency MsgInit $
133
133
Effect $ outboundRun <$> outboundSt
0 commit comments