readline icon indicating copy to clipboard operation
readline copied to clipboard

Reading from differents threads sharing the same Instance

Open Slixe opened this issue 1 year ago • 0 comments

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.

Slixe avatar Aug 03 '23 21:08 Slixe