@@ -44,255 +44,232 @@ public Model(ConnectionConfig config, ISession session) : base(config, session)
44
44
45
45
public override void ConnectionTuneOk ( ushort channelMax , uint frameMax , ushort heartbeat )
46
46
{
47
- var cmd = new ConnectionTuneOk ( channelMax , frameMax , heartbeat ) ;
48
- ModelSend ( ref cmd ) ;
47
+ ModelSend ( new ConnectionTuneOk ( channelMax , frameMax , heartbeat ) ) ;
49
48
}
50
49
51
50
public override void _Private_BasicCancel ( string consumerTag , bool nowait )
52
51
{
53
- var cmd = new BasicCancel ( consumerTag , nowait ) ;
54
- ModelSend ( ref cmd ) ;
52
+ ModelSend ( new BasicCancel ( consumerTag , nowait ) ) ;
55
53
}
56
54
57
55
public override void _Private_BasicConsume ( string queue , string consumerTag , bool noLocal , bool autoAck , bool exclusive , bool nowait , IDictionary < string , object > arguments )
58
56
{
59
- var cmd = new BasicConsume ( queue , consumerTag , noLocal , autoAck , exclusive , nowait , arguments ) ;
60
- ModelSend ( ref cmd ) ;
57
+ ModelSend ( new BasicConsume ( queue , consumerTag , noLocal , autoAck , exclusive , nowait , arguments ) ) ;
61
58
}
62
59
63
60
public override void _Private_BasicGet ( string queue , bool autoAck )
64
61
{
65
- var cmd = new BasicGet ( queue , autoAck ) ;
66
- ModelSend ( ref cmd ) ;
62
+ ModelSend ( new BasicGet ( queue , autoAck ) ) ;
67
63
}
68
64
69
65
public override void _Private_BasicRecover ( bool requeue )
70
66
{
71
- var cmd = new BasicRecover ( requeue ) ;
72
- ModelSend ( ref cmd ) ;
67
+ ModelSend ( new BasicRecover ( requeue ) ) ;
73
68
}
74
69
75
70
public override void _Private_ChannelClose ( ushort replyCode , string replyText , ushort classId , ushort methodId )
76
71
{
77
- var cmd = new ChannelClose ( replyCode , replyText , classId , methodId ) ;
78
- ModelSend ( ref cmd ) ;
72
+ ModelSend ( new ChannelClose ( replyCode , replyText , classId , methodId ) ) ;
79
73
}
80
74
81
75
public override void _Private_ChannelCloseOk ( )
82
76
{
83
- var cmd = new ChannelCloseOk ( ) ;
84
- ModelSend ( ref cmd ) ;
77
+ ModelSend ( new ChannelCloseOk ( ) ) ;
85
78
}
86
79
87
80
public override void _Private_ChannelFlowOk ( bool active )
88
81
{
89
- var cmd = new ChannelFlowOk ( active ) ;
90
- ModelSend ( ref cmd ) ;
82
+ ModelSend ( new ChannelFlowOk ( active ) ) ;
91
83
}
92
84
93
85
public override void _Private_ChannelOpen ( )
94
86
{
95
- var cmd = new ChannelOpen ( ) ;
96
- ModelRpc ( ref cmd , ProtocolCommandId . ChannelOpenOk ) ;
87
+ ModelRpc ( new ChannelOpen ( ) , ProtocolCommandId . ChannelOpenOk ) ;
97
88
}
98
89
99
90
public override void _Private_ConfirmSelect ( bool nowait )
100
91
{
101
92
var method = new ConfirmSelect ( nowait ) ;
102
93
if ( nowait )
103
94
{
104
- ModelSend ( ref method ) ;
95
+ ModelSend ( method ) ;
105
96
}
106
97
else
107
98
{
108
- ModelRpc ( ref method , ProtocolCommandId . ConfirmSelectOk ) ;
99
+ ModelRpc ( method , ProtocolCommandId . ConfirmSelectOk ) ;
109
100
}
110
101
}
111
102
112
103
public override void _Private_ConnectionCloseOk ( )
113
104
{
114
- var cmd = new ConnectionCloseOk ( ) ;
115
- ModelSend ( ref cmd ) ;
105
+ ModelSend ( new ConnectionCloseOk ( ) ) ;
116
106
}
117
107
118
108
public override void _Private_ConnectionOpen ( string virtualHost )
119
109
{
120
- var cmd = new ConnectionOpen ( virtualHost ) ;
121
- ModelSend ( ref cmd ) ;
110
+ ModelSend ( new ConnectionOpen ( virtualHost ) ) ;
122
111
}
123
112
124
113
public override void _Private_ConnectionSecureOk ( byte [ ] response )
125
114
{
126
- var cmd = new ConnectionSecureOk ( response ) ;
127
- ModelSend ( ref cmd ) ;
115
+ ModelSend ( new ConnectionSecureOk ( response ) ) ;
128
116
}
129
117
130
118
public override void _Private_ConnectionStartOk ( IDictionary < string , object > clientProperties , string mechanism , byte [ ] response , string locale )
131
119
{
132
- var cmd = new ConnectionStartOk ( clientProperties , mechanism , response , locale ) ;
133
- ModelSend ( ref cmd ) ;
120
+ ModelSend ( new ConnectionStartOk ( clientProperties , mechanism , response , locale ) ) ;
134
121
}
135
122
136
123
public override void _Private_UpdateSecret ( byte [ ] newSecret , string reason )
137
124
{
138
- var cmd = new ConnectionUpdateSecret ( newSecret , reason ) ;
139
- ModelRpc ( ref cmd , ProtocolCommandId . ConnectionUpdateSecretOk ) ;
125
+ ModelRpc ( new ConnectionUpdateSecret ( newSecret , reason ) , ProtocolCommandId . ConnectionUpdateSecretOk ) ;
140
126
}
141
127
142
128
public override void _Private_ExchangeBind ( string destination , string source , string routingKey , bool nowait , IDictionary < string , object > arguments )
143
129
{
144
- ExchangeBind method = new ExchangeBind ( destination , source , routingKey , nowait , arguments ) ;
130
+ var method = new ExchangeBind ( destination , source , routingKey , nowait , arguments ) ;
145
131
if ( nowait )
146
132
{
147
- ModelSend ( ref method ) ;
133
+ ModelSend ( method ) ;
148
134
}
149
135
else
150
136
{
151
- ModelRpc ( ref method , ProtocolCommandId . ExchangeBindOk ) ;
137
+ ModelRpc ( method , ProtocolCommandId . ExchangeBindOk ) ;
152
138
}
153
139
}
154
140
155
141
public override void _Private_ExchangeDeclare ( string exchange , string type , bool passive , bool durable , bool autoDelete , bool @internal , bool nowait , IDictionary < string , object > arguments )
156
142
{
157
- ExchangeDeclare method = new ExchangeDeclare ( exchange , type , passive , durable , autoDelete , @internal , nowait , arguments ) ;
143
+ var method = new ExchangeDeclare ( exchange , type , passive , durable , autoDelete , @internal , nowait , arguments ) ;
158
144
if ( nowait )
159
145
{
160
- ModelSend ( ref method ) ;
146
+ ModelSend ( method ) ;
161
147
}
162
148
else
163
149
{
164
- ModelRpc ( ref method , ProtocolCommandId . ExchangeDeclareOk ) ;
150
+ ModelRpc ( method , ProtocolCommandId . ExchangeDeclareOk ) ;
165
151
}
166
152
}
167
153
168
154
public override void _Private_ExchangeDelete ( string exchange , bool ifUnused , bool nowait )
169
155
{
170
- ExchangeDelete method = new ExchangeDelete ( exchange , ifUnused , nowait ) ;
156
+ var method = new ExchangeDelete ( exchange , ifUnused , nowait ) ;
171
157
if ( nowait )
172
158
{
173
- ModelSend ( ref method ) ;
159
+ ModelSend ( method ) ;
174
160
}
175
161
else
176
162
{
177
- ModelRpc ( ref method , ProtocolCommandId . ExchangeDeleteOk ) ;
163
+ ModelRpc ( method , ProtocolCommandId . ExchangeDeleteOk ) ;
178
164
}
179
165
}
180
166
181
167
public override void _Private_ExchangeUnbind ( string destination , string source , string routingKey , bool nowait , IDictionary < string , object > arguments )
182
168
{
183
- ExchangeUnbind method = new ExchangeUnbind ( destination , source , routingKey , nowait , arguments ) ;
169
+ var method = new ExchangeUnbind ( destination , source , routingKey , nowait , arguments ) ;
184
170
if ( nowait )
185
171
{
186
- ModelSend ( ref method ) ;
172
+ ModelSend ( method ) ;
187
173
}
188
174
else
189
175
{
190
- ModelRpc ( ref method , ProtocolCommandId . ExchangeUnbindOk ) ;
176
+ ModelRpc ( method , ProtocolCommandId . ExchangeUnbindOk ) ;
191
177
}
192
178
}
193
179
194
180
public override void _Private_QueueBind ( string queue , string exchange , string routingKey , bool nowait , IDictionary < string , object > arguments )
195
181
{
196
- QueueBind method = new QueueBind ( queue , exchange , routingKey , nowait , arguments ) ;
182
+ var method = new QueueBind ( queue , exchange , routingKey , nowait , arguments ) ;
197
183
if ( nowait )
198
184
{
199
- ModelSend ( ref method ) ;
185
+ ModelSend ( method ) ;
200
186
}
201
187
else
202
188
{
203
- ModelRpc ( ref method , ProtocolCommandId . QueueBindOk ) ;
189
+ ModelRpc ( method , ProtocolCommandId . QueueBindOk ) ;
204
190
}
205
191
}
206
192
207
193
public override void _Private_QueueDeclare ( string queue , bool passive , bool durable , bool exclusive , bool autoDelete , bool nowait , IDictionary < string , object > arguments )
208
194
{
209
- QueueDeclare method = new QueueDeclare ( queue , passive , durable , exclusive , autoDelete , nowait , arguments ) ;
195
+ var method = new QueueDeclare ( queue , passive , durable , exclusive , autoDelete , nowait , arguments ) ;
210
196
if ( nowait )
211
197
{
212
- ModelSend ( ref method ) ;
198
+ ModelSend ( method ) ;
213
199
}
214
200
else
215
201
{
216
- ModelSend ( ref method ) ;
202
+ ModelSend ( method ) ;
217
203
}
218
204
}
219
205
220
206
public override uint _Private_QueueDelete ( string queue , bool ifUnused , bool ifEmpty , bool nowait )
221
207
{
222
- QueueDelete method = new QueueDelete ( queue , ifUnused , ifEmpty , nowait ) ;
208
+ var method = new QueueDelete ( queue , ifUnused , ifEmpty , nowait ) ;
223
209
if ( nowait )
224
210
{
225
- ModelSend ( ref method ) ;
211
+ ModelSend ( method ) ;
226
212
return 0xFFFFFFFF ;
227
213
}
228
214
229
- return ModelRpc ( ref method , ProtocolCommandId . QueueDeleteOk , memory => new QueueDeleteOk ( memory . Span ) . _messageCount ) ;
215
+ return ModelRpc ( method , ProtocolCommandId . QueueDeleteOk , memory => new QueueDeleteOk ( memory . Span ) . _messageCount ) ;
230
216
}
231
217
232
218
public override uint _Private_QueuePurge ( string queue , bool nowait )
233
219
{
234
- QueuePurge method = new QueuePurge ( queue , nowait ) ;
220
+ var method = new QueuePurge ( queue , nowait ) ;
235
221
if ( nowait )
236
222
{
237
- ModelSend ( ref method ) ;
223
+ ModelSend ( method ) ;
238
224
return 0xFFFFFFFF ;
239
225
}
240
226
241
- return ModelRpc ( ref method , ProtocolCommandId . QueuePurgeOk , memory => new QueuePurgeOk ( memory . Span ) . _messageCount ) ;
227
+ return ModelRpc ( method , ProtocolCommandId . QueuePurgeOk , memory => new QueuePurgeOk ( memory . Span ) . _messageCount ) ;
242
228
}
243
229
244
230
public override void BasicAck ( ulong deliveryTag , bool multiple )
245
231
{
246
- var cmd = new BasicAck ( deliveryTag , multiple ) ;
247
- ModelSend ( ref cmd ) ;
232
+ ModelSend ( new BasicAck ( deliveryTag , multiple ) ) ;
248
233
}
249
234
250
235
public override void BasicNack ( ulong deliveryTag , bool multiple , bool requeue )
251
236
{
252
- var cmd = new BasicNack ( deliveryTag , multiple , requeue ) ;
253
- ModelSend ( ref cmd ) ;
237
+ ModelSend ( new BasicNack ( deliveryTag , multiple , requeue ) ) ;
254
238
}
255
239
256
240
public override void BasicQos ( uint prefetchSize , ushort prefetchCount , bool global )
257
241
{
258
- var cmd = new BasicQos ( prefetchSize , prefetchCount , global ) ;
259
- ModelRpc ( ref cmd , ProtocolCommandId . BasicQosOk ) ;
242
+ ModelRpc ( new BasicQos ( prefetchSize , prefetchCount , global ) , ProtocolCommandId . BasicQosOk ) ;
260
243
}
261
244
262
245
public override void BasicRecoverAsync ( bool requeue )
263
246
{
264
- var cmd = new BasicRecoverAsync ( requeue ) ;
265
- ModelSend ( ref cmd ) ;
247
+ ModelSend ( new BasicRecoverAsync ( requeue ) ) ;
266
248
}
267
249
268
250
public override void BasicReject ( ulong deliveryTag , bool requeue )
269
251
{
270
- var cmd = new BasicReject ( deliveryTag , requeue ) ;
271
- ModelSend ( ref cmd ) ;
252
+ ModelSend ( new BasicReject ( deliveryTag , requeue ) ) ;
272
253
}
273
254
274
255
public override void QueueUnbind ( string queue , string exchange , string routingKey , IDictionary < string , object > arguments )
275
256
{
276
- var cmd = new QueueUnbind ( queue , exchange , routingKey , arguments ) ;
277
- ModelRpc ( ref cmd , ProtocolCommandId . QueueUnbindOk ) ;
257
+ ModelRpc ( new QueueUnbind ( queue , exchange , routingKey , arguments ) , ProtocolCommandId . QueueUnbindOk ) ;
278
258
}
279
259
280
260
public override void TxCommit ( )
281
261
{
282
- var cmd = new TxCommit ( ) ;
283
- ModelRpc ( ref cmd , ProtocolCommandId . TxCommitOk ) ;
262
+ ModelRpc ( new TxCommit ( ) , ProtocolCommandId . TxCommitOk ) ;
284
263
}
285
264
286
265
public override void TxRollback ( )
287
266
{
288
- var cmd = new TxRollback ( ) ;
289
- ModelRpc ( ref cmd , ProtocolCommandId . TxRollbackOk ) ;
267
+ ModelRpc ( new TxRollback ( ) , ProtocolCommandId . TxRollbackOk ) ;
290
268
}
291
269
292
270
public override void TxSelect ( )
293
271
{
294
- var cmd = new TxSelect ( ) ;
295
- ModelRpc ( ref cmd , ProtocolCommandId . TxSelectOk ) ;
272
+ ModelRpc ( new TxSelect ( ) , ProtocolCommandId . TxSelectOk ) ;
296
273
}
297
274
298
275
protected override bool DispatchAsynchronous ( in IncomingCommand cmd )
0 commit comments