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

Reading from differents threads sharing the same Instance #230

Open
Slixe opened this issue Aug 3, 2023 · 0 comments
Open

Reading from differents threads sharing the same Instance #230

Slixe opened this issue Aug 3, 2023 · 0 comments

Comments

@Slixe
Copy link

Slixe commented Aug 3, 2023

Hey there,

I'm curious, would it be possible to share the instance between two differents threads ? What I want to achieve is the following:

  • main thread in main.go is a infinite loop which read all commands and block on line, err := instance.Readline()
  • A go routine can sometimes read from same instance but using instance.ReadPasswordWithConfig(conf) with a custom config.

The go routine would have priority on read and the main thread would be on hold for it. How to achieve that ?
Thanks in advance.

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