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

Interactive client example? #291

Closed
bilogic opened this issue May 10, 2022 · 2 comments
Closed

Interactive client example? #291

bilogic opened this issue May 10, 2022 · 2 comments
Labels

Comments

@bilogic
Copy link

bilogic commented May 10, 2022

Hi,

I'm having trouble writing "elegant" code for an interactive client, i.e. imap client, IRC client

Specifically, I find it very hard to write in a way that makes sense which is the 1st step, which is 2nd etc due to the reactive/event driven nature, e.g.

  1. Login
  2. If login success, select a mailbox/join a channel
  3. Then check how many messages there are/who is in the chat group

Most of the samples are a 1 transaction protocols like HTTP and I can't see any that applies the concepts of await etc

Possible to make a simple example, say POP3? Thank you!

@SimonFrings
Copy link
Member

Hey @bilogic

I don't know if I understand you correctly but if your looking for a interactive communication via CLI, you should take a look at clue/reactphp-stdio. @clue also has a project that sounds similar to yours: clue/reactphp-quassel.

Hope this will help you as a first step to move on. Let me know if you have any further questions!

@bilogic
Copy link
Author

bilogic commented May 10, 2022

Hey thanks!

Doesn't have to be interactive, it's more like how to make it not take the next steps until the earlier has succeeded, e.g. don't select a mailbox until login is complete. Sometimes multiple such sequential steps are needed and it makes my code quite unreadable, let alone testable.

I'm trying to get something going with https://github.com/shuchkin/react-smtp-client, let me take a closer look at your suggestions. Thank you.

@bilogic bilogic closed this as completed May 11, 2022
@clue clue added the question label Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants