20
20
attach_sender_link /3 ,
21
21
attach_sender_link /4 ,
22
22
attach_sender_link /5 ,
23
+ attach_sender_link /6 ,
23
24
attach_sender_link_sync /3 ,
24
25
attach_sender_link_sync /4 ,
25
26
attach_sender_link_sync /5 ,
27
+ attach_sender_link_sync /6 ,
26
28
attach_receiver_link /3 ,
27
29
attach_receiver_link /4 ,
28
30
attach_receiver_link /5 ,
29
31
attach_receiver_link /6 ,
30
32
attach_receiver_link /7 ,
33
+ attach_receiver_link /8 ,
31
34
attach_link /2 ,
32
35
detach_link /1 ,
33
36
send_msg /2 ,
@@ -182,8 +185,19 @@ attach_sender_link_sync(Session, Name, Target, SettleMode) ->
182
185
snd_settle_mode (), terminus_durability ()) ->
183
186
{ok , link_ref ()} | link_timeout .
184
187
attach_sender_link_sync (Session , Name , Target , SettleMode , Durability ) ->
188
+ attach_sender_link_sync (Session , Name , Target , SettleMode , Durability , none ).
189
+
190
+ % % @doc Synchronously attach a link on 'Session'.
191
+ % % This is a convenience function that awaits attached event
192
+ % % for the link before returning.
193
+ -spec attach_sender_link_sync (pid (), binary (), binary (),
194
+ snd_settle_mode (), terminus_durability (),
195
+ binary () | list ()) ->
196
+ {ok , link_ref ()} | link_timeout .
197
+
198
+ attach_sender_link_sync (Session , Name , Target , SettleMode , Durability , Capabilities ) ->
185
199
{ok , Ref } = attach_sender_link (Session , Name , Target , SettleMode ,
186
- Durability ),
200
+ Durability , Capabilities ),
187
201
receive
188
202
{amqp10_event , {link , Ref , attached }} ->
189
203
{ok , Ref };
@@ -226,6 +240,23 @@ attach_sender_link(Session, Name, Target, SettleMode, Durability) ->
226
240
rcv_settle_mode => first },
227
241
amqp10_client_session :attach (Session , AttachArgs ).
228
242
243
+ % % @doc Attaches a sender link to a target.
244
+ % % This is asynchronous and will notify completion of the attach request to the
245
+ % % caller using an amqp10_event of the following format:
246
+ % % {amqp10_event, {link, LinkRef, attached | {detached, Why}}}
247
+ -spec attach_sender_link (pid (), binary (), binary (),
248
+ snd_settle_mode (), terminus_durability (),
249
+ binary () | list ()) ->
250
+ {ok , link_ref ()}.
251
+ attach_sender_link (Session , Name , Target , SettleMode , Durability , Capabilities ) ->
252
+ AttachArgs = #{name => Name ,
253
+ role => {sender , #{address => Target ,
254
+ durable => Durability ,
255
+ capabilities => Capabilities }},
256
+ snd_settle_mode => SettleMode ,
257
+ rcv_settle_mode => first },
258
+ amqp10_client_session :attach (Session , AttachArgs ).
259
+
229
260
% % @doc Attaches a receiver link to a source.
230
261
% % This is asynchronous and will notify completion of the attach request to the
231
262
% % caller using an amqp10_event of the following format:
@@ -272,7 +303,19 @@ attach_receiver_link(Session, Name, Source, SettleMode, Durability, Filter) ->
272
303
-spec attach_receiver_link (pid (), binary (), binary (), snd_settle_mode (),
273
304
terminus_durability (), filter (), properties ()) ->
274
305
{ok , link_ref ()}.
275
- attach_receiver_link (Session , Name , Source , SettleMode , Durability , Filter , Properties )
306
+ attach_receiver_link (Session , Name , Source , SettleMode , Durability , Filter , Properties ) ->
307
+ attach_receiver_link (Session , Name , Source , SettleMode , Durability , Filter , Properties , none ).
308
+
309
+ % % @doc Attaches a receiver link to a source.
310
+ % % This is asynchronous and will notify completion of the attach request to the
311
+ % % caller using an amqp10_event of the following format:
312
+ % % {amqp10_event, {link, LinkRef, attached | {detached, Why}}}
313
+ -spec attach_receiver_link (pid (), binary (), binary (), snd_settle_mode (),
314
+ terminus_durability (), filter (), properties (),
315
+ binary () | list ()) ->
316
+ {ok , link_ref ()}.
317
+ attach_receiver_link (Session , Name , Source , SettleMode , Durability , Filter ,
318
+ Properties , Capabilities )
276
319
when is_pid (Session ) andalso
277
320
is_binary (Name ) andalso
278
321
is_binary (Source ) andalso
@@ -281,10 +324,13 @@ attach_receiver_link(Session, Name, Source, SettleMode, Durability, Filter, Prop
281
324
SettleMode == mixed ) andalso
282
325
is_atom (Durability ) andalso
283
326
is_map (Filter ) andalso
284
- is_map (Properties ) ->
327
+ is_map (Properties ) andalso
328
+ is_list (Capabilities ) orelse
329
+ (Capabilities == none orelse is_binary (Capabilities )) ->
285
330
AttachArgs = #{name => Name ,
286
331
role => {receiver , #{address => Source ,
287
- durable => Durability }, self ()},
332
+ durable => Durability ,
333
+ capabilities => Capabilities }, self ()},
288
334
snd_settle_mode => SettleMode ,
289
335
rcv_settle_mode => first ,
290
336
filter => Filter ,
0 commit comments