Add Gitter support
This commit is contained in:
22
vendor/github.com/mrexodia/wray/schedular.go
generated
vendored
Normal file
22
vendor/github.com/mrexodia/wray/schedular.go
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user