2019-11-24 12:27:50 +01:00
|
|
|
module main
|
|
|
|
|
2020-04-26 13:49:31 +02:00
|
|
|
import some_module
|
2019-11-24 12:27:50 +01:00
|
|
|
|
2021-04-20 16:16:35 +02:00
|
|
|
fn main() {
|
2019-11-24 12:27:50 +01:00
|
|
|
mut sub := some_module.get_subscriber()
|
2021-04-20 16:16:35 +02:00
|
|
|
sub.subscribe('error', on_error)
|
2019-11-24 12:27:50 +01:00
|
|
|
some_module.do_work()
|
|
|
|
}
|
|
|
|
|
2021-02-22 17:44:15 +01:00
|
|
|
fn on_error(sender voidptr, e &some_module.MyError, x voidptr) {
|
2020-01-22 17:41:08 +01:00
|
|
|
println(e.message)
|
2019-12-01 08:33:26 +01:00
|
|
|
}
|