aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/examples/eventbus/eventbus.v
blob: 042feb837a347910e0b0b3a2f2f0ba0a780d2d95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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)
}