blob: 3453fd61d04f7cc1387c3347a7ea0afece29423c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)
}
|