1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/examples/eventbus/eventbus.v

14 lines
232 B
V
Raw Normal View History

module main
2020-04-26 14:49:31 +03:00
import some_module
fn main(){
mut sub := some_module.get_subscriber()
sub.subscribe("error", on_error)
some_module.do_work()
}
2021-02-22 19:44:15 +03:00
fn on_error(sender voidptr, e &some_module.MyError, x voidptr) {
2020-01-22 19:41:08 +03:00
println(e.message)
2019-12-01 10:33:26 +03:00
}