mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin: add methods to builtin channels (#6303)
This commit is contained in:
20
vlib/builtin/chan.v
Executable file
20
vlib/builtin/chan.v
Executable file
@@ -0,0 +1,20 @@
|
||||
module builtin
|
||||
|
||||
enum ChanState {
|
||||
success
|
||||
not_ready // push()/pop() would have to wait, but no_block was requested
|
||||
closed
|
||||
}
|
||||
|
||||
// The following methods are only stubs. The real implementation
|
||||
// is in `vlib/sync/channels.v`
|
||||
|
||||
pub fn (ch chan) close() {}
|
||||
|
||||
pub fn (ch chan) try_pop(obj voidptr) ChanState {
|
||||
return .success
|
||||
}
|
||||
|
||||
pub fn (ch chan) try_push(obj voidptr) ChanState {
|
||||
return .success
|
||||
}
|
||||
Reference in New Issue
Block a user