mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v test v => v test-compiler
This commit is contained in:

committed by
Alexander Medvednikov

parent
854309a7d8
commit
ec15bfb7d1
27
examples/eventbus/modules/some_module/some_module.v
Normal file
27
examples/eventbus/modules/some_module/some_module.v
Normal file
@ -0,0 +1,27 @@
|
||||
module some_module
|
||||
|
||||
import (
|
||||
eventbus
|
||||
)
|
||||
|
||||
const (
|
||||
eb = eventbus.new()
|
||||
)
|
||||
|
||||
pub fn do_work(){
|
||||
mut params := eventbus.Params{}
|
||||
for i in 0..20 {
|
||||
println("working...")
|
||||
if i == 15 {
|
||||
params.put_string("error", "CRASH!!")
|
||||
eb.publish("error", params)
|
||||
eb.publish("error", params)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pub fn get_subscriber() eventbus.Subscriber {
|
||||
return eb.subscriber
|
||||
}
|
Reference in New Issue
Block a user