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

14 lines
232 B
V

module main
import some_module
fn main(){
mut sub := some_module.get_subscriber()
sub.subscribe("error", on_error)
some_module.do_work()
}
fn on_error(sender voidptr, e &some_module.MyError, x voidptr) {
println(e.message)
}