-
Notifications
You must be signed in to change notification settings - Fork 10
/
wrap.go
15 lines (12 loc) · 597 Bytes
/
wrap.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright (c) 2023 cheng-zhongliang. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package event
// NewTimer creates a new timer event.
func NewTimer(base *EventBase, callback func(fd int, events uint32, arg interface{}), arg interface{}) *Event {
return New(base, -1, EvTimeout, callback, arg)
}
// NewTicker creates a new ticker event.
func NewTicker(base *EventBase, callback func(fd int, events uint32, arg interface{}), arg interface{}) *Event {
return New(base, -1, EvTimeout|EvPersist, callback, arg)
}