matterbridge/vendor/github.com/mrexodia/wray/schedular.go

23 lines
354 B
Go
Raw Normal View History

2016-09-04 18:03:07 +00:00
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)
}