mirror of
https://github.com/cwinfo/matterbridge.git
synced 2024-11-14 05:00:27 +00:00
23 lines
354 B
Go
23 lines
354 B
Go
|
package wray
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
type Schedular interface {
|
||
|
wait(time.Duration, func())
|
||
|
delay() time.Duration
|
||
|
}
|
||
|
|
||
|
type ChannelSchedular struct {
|
||
|
}
|
||
|
|
||
|
func (self ChannelSchedular) wait(delay time.Duration, callback func()) {
|
||
|
go func() {
|
||
|
time.Sleep(delay)
|
||
|
callback()
|
||
|
}()
|
||
|
}
|
||
|
|
||
|
func (self ChannelSchedular) delay() time.Duration {
|
||
|
return (1 * time.Minute)
|
||
|
}
|