@@ -191,8 +191,8 @@ mutable struct Connection
191
191
heartbeat_time_server:: Float64
192
192
heartbeat_time_client:: Float64
193
193
194
- function Connection (virtualhost:: String = " /" , host:: String = " localhost" , port:: Int = AMQP_DEFAULT_PORT)
195
- sendq = Channel {TAMQPGenericFrame} (CONN_MAX_QUEUED )
194
+ function Connection (virtualhost:: String = " /" , host:: String = " localhost" , port:: Int = AMQP_DEFAULT_PORT; send_queue_size :: Int = CONN_MAX_QUEUED )
195
+ sendq = Channel {TAMQPGenericFrame} (send_queue_size )
196
196
sendlck = Channel {UInt8} (1 )
197
197
put! (sendlck, 1 )
198
198
new (virtualhost, host, port, nothing ,
@@ -248,6 +248,13 @@ mutable struct MessageChannel <: AbstractChannel
248
248
end
249
249
end
250
250
251
+ flush (c:: MessageChannel ) = flush (c. conn)
252
+ function flush (c:: Connection )
253
+ while isready (c. sendq) && (c. sender != = nothing ) && ! istaskdone (c. sender)
254
+ yield ()
255
+ end
256
+ end
257
+
251
258
sock (c:: MessageChannel ) = sock (c. conn)
252
259
sock (c:: Connection ) = c. sock
253
260
@@ -492,9 +499,15 @@ function channel(c::Connection, id::Integer, create::Bool; connect_timeout=DEFAU
492
499
chan
493
500
end
494
501
495
- function connection (;virtualhost= " /" , host= " localhost" , port= AMQPClient. AMQP_DEFAULT_PORT, auth_params= AMQPClient. DEFAULT_AUTH_PARAMS, channelmax= AMQPClient. DEFAULT_CHANNELMAX, framemax= 0 , heartbeat= 0 , connect_timeout= AMQPClient. DEFAULT_CONNECT_TIMEOUT)
502
+ function connection (; virtualhost= " /" , host= " localhost" , port= AMQPClient. AMQP_DEFAULT_PORT,
503
+ framemax= 0 ,
504
+ heartbeat= 0 ,
505
+ send_queue_size:: Integer = CONN_MAX_QUEUED,
506
+ auth_params= AMQPClient. DEFAULT_AUTH_PARAMS,
507
+ channelmax:: Integer = AMQPClient. DEFAULT_CHANNELMAX,
508
+ connect_timeout= AMQPClient. DEFAULT_CONNECT_TIMEOUT)
496
509
@debug (" connecting" , host, port, virtualhost)
497
- conn = AMQPClient. Connection (virtualhost, host, port)
510
+ conn = AMQPClient. Connection (virtualhost, host, port; send_queue_size = send_queue_size )
498
511
chan = channel (conn, AMQPClient. DEFAULT_CHANNEL, true )
499
512
500
513
# setup handler for Connection.Start
0 commit comments