Closed albulescu closed 4 years ago
Don't know if is the right approach for:
e.On("upload", function(ev *emitter.Emitter) { // Processing upload and return result ev.Result <- errors.New("Some error") // or ev.Result <- &CustomResult{} }); ch := e.Emit("upload", file, header) select { case v := <-ch: fmt.Println("Result:", v) case <-time.After(time.Second): fmt.Println("Timeout") }
// Also the following might be helpful
bus.On("test", func(ev *Event, a, b int) {}) // Maybe event optional bus.Emit("test", 1, 2)
Don't know if is the right approach for:
// Also the following might be helpful