Initializing messageChannel
This commit is contained in:
parent
6864ffa5fb
commit
715a25a6d4
|
@ -27,6 +27,7 @@ func (t *TUI) init() error {
|
||||||
t.readInputState = make(chan bool, 1)
|
t.readInputState = make(chan bool, 1)
|
||||||
t.readEnterState = make(chan bool, 1)
|
t.readEnterState = make(chan bool, 1)
|
||||||
t.stateChannel = make(chan string, 1)
|
t.stateChannel = make(chan string, 1)
|
||||||
|
t.messageChannel = make(chan []byte, 8)
|
||||||
signal.Notify(t.osSignals, syscall.SIGWINCH)
|
signal.Notify(t.osSignals, syscall.SIGWINCH)
|
||||||
err = t.setSizes()
|
err = t.setSizes()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -177,6 +178,13 @@ func (t *TUI) setRoutines() error {
|
||||||
if t.stateChannel == nil {
|
if t.stateChannel == nil {
|
||||||
return errors.WrapErr("t.stateChannel", errors.NOT_INIT)
|
return errors.WrapErr("t.stateChannel", errors.NOT_INIT)
|
||||||
}
|
}
|
||||||
|
if t.messageChannel == nil {
|
||||||
|
return errors.WrapErr("t.messageChannel", errors.NOT_INIT)
|
||||||
|
}
|
||||||
|
go func() {
|
||||||
|
for message := range t.messageChannel {
|
||||||
|
}
|
||||||
|
}()
|
||||||
go func() {
|
go func() {
|
||||||
for state := range t.stateChannel {
|
for state := range t.stateChannel {
|
||||||
t.writeMu.Lock()
|
t.writeMu.Lock()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user