aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/vlib/os/notify/notify.v
blob: b49dad3fdb2610847832bada229f715b096cf61c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
module notify

import time

// Backends should provide a `new() ?FdNotifier` function
pub interface FdNotifier {
	add(fd int, events FdEventType, conf ...FdConfigFlags) ?
	modify(fd int, events FdEventType, conf ...FdConfigFlags) ?
	remove(fd int) ?
	wait(timeout time.Duration) []FdEvent
	close() ?
}

pub interface FdEvent {
	fd int
	kind FdEventType
}

[flag]
pub enum FdEventType {
	read
	write
	peer_hangup
	exception
	error
	hangup
}

[flag]
pub enum FdConfigFlags {
	edge_trigger
	one_shot
	wake_up
	exclusive
}