mirror of https://git.sr.ht/~michalr/go-satel
Configurable pooling interval
This commit is contained in:
parent
053187c5d1
commit
8979c2dd1e
3
satel.go
3
satel.go
|
@ -21,6 +21,7 @@ type Event struct {
|
||||||
type Config struct {
|
type Config struct {
|
||||||
EventsQueueSize int
|
EventsQueueSize int
|
||||||
LongCommands bool
|
LongCommands bool
|
||||||
|
PoolingInterval time.Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
type Satel struct {
|
type Satel struct {
|
||||||
|
@ -65,7 +66,7 @@ func NewConfig(conn net.Conn, config Config) *Satel {
|
||||||
}
|
}
|
||||||
s.readRawEvents()
|
s.readRawEvents()
|
||||||
}
|
}
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(config.PoolingInterval)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
go func() {
|
go func() {
|
||||||
|
|
Loading…
Reference in New Issue