On Thu, Feb 20, 2020 at 8:55 AM Rick van Rein <[email protected]> wrote:

> Hello,
>
> If I understand correctly, then Containers can be connected to multiple
> peers, in any combination of sending and receiving.  So I should be able
> to call Container.connect() as often as I need.
>
> 1. To avoid more connections than required, is there a way to see if a
> connection to a peer already exists, and to reuse it?
>

AFAIK there isn't any built-in way to query a Container for existing
connections. You can keep a map of connections by remote container for
yourself.

2. Could I see what links are in there and whether they have credits to
> send?  Alternatively I could queue, but might end up waiting forever
> with credits ready to go :)
>

Connection.link_head and Link.next allow you to iterate over links on a
connection, the Link objects let you check credit etc.


> These two questions arise when my Container receives an ApplicationEvent
> to send a Message to a given peer,
>
> https://gitlab.com/arpa2/reservoir/-/blob/feature-amqp/src/reservoir/internetwide.py#L175-184
>
> Thanks,
>  -Rick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to