2019-11-24 14:27:50 +03:00
|
|
|
module main
|
|
|
|
|
|
|
|
import (
|
|
|
|
some_module
|
|
|
|
eventbus
|
|
|
|
)
|
|
|
|
|
|
|
|
fn main(){
|
|
|
|
mut sub := some_module.get_subscriber()
|
|
|
|
sub.subscribe("error", on_error)
|
|
|
|
some_module.do_work()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn on_error(p eventbus.Params) {
|
|
|
|
println(p.get_string("error"))
|
2019-12-01 10:33:26 +03:00
|
|
|
}
|