Right now, when you write a client, Cro::Connector makes a connection for you to a remote host and emits socket -> transform -> socket pipelines to work with.
However, from what I can understand, result of the connect is async - there is no way to receive a result of a connection before e.g. first message is sent, is there?
As LDAP is oriented on connection, not a message, I am looking for:
Try to establish a connection on host/port, return a promise, if it fails(bad host/port), then break the promise immediately.
What I am doing now is https://github.com/Altai-man/cro-ldap/blob/master/lib/Cro/LDAP/Client.pm6#L157-L158 but the issue is that even with incorrect host/port pair, the exception indeed occurs in establish supply, but I can't reach it from the outside, it is just a Supply.
(ignore the Promise.kept line, I know it will be always kept, the question is how to make get-pipeline to produce a sync exception).
Right now, when you write a client, Cro::Connector makes a connection for you to a remote host and emits socket -> transform -> socket pipelines to work with.
However, from what I can understand, result of the connect is async - there is no way to receive a result of a connection before e.g. first message is sent, is there?
As LDAP is oriented on connection, not a message, I am looking for:
But from how
establish
method is implemented(https://github.com/croservices/cro-core/blob/master/lib/Cro/Connector.pm6#L9), I see no ways to do that. Any ideas?What I am doing now is https://github.com/Altai-man/cro-ldap/blob/master/lib/Cro/LDAP/Client.pm6#L157-L158 but the issue is that even with incorrect host/port pair, the exception indeed occurs in
establish
supply, but I can't reach it from the outside, it is just a Supply. (ignore the Promise.kept line, I know it will be always kept, the question is how to makeget-pipeline
to produce a sync exception).