Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cro::Connector suggests message-oriented protocols (?) #12

Open
Altai-man opened this issue Jul 8, 2019 · 0 comments
Open

Cro::Connector suggests message-oriented protocols (?) #12

Altai-man opened this issue Jul 8, 2019 · 0 comments

Comments

@Altai-man
Copy link
Member

Altai-man commented Jul 8, 2019

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.

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 make get-pipeline to produce a sync exception).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant