readline
readline copied to clipboard
Reading from differents threads sharing the same Instance
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.