chuckpreslar/emission

Need an option to disable concurrent function calls

Closed this issue · 4 comments

In one of my projects, my code assumes a non-concurrent context. I'm mainly use "emission" as a observer pattern implementation and want it call functions one by one during Emit. The order is not important to me.

I'll get this feature implemented at some point this week, @zhaoyeming.

@zhaoyeming -- I've updated the master branch to accommodate the change you've requested. The functionality is implemented within a new method on the Emitter struct named EmitSync(event interface{}, ...arguments interface{}) . Please pull it down and make sure it's what you're looking for; if so, I'm going to clean it up as it's basically copy and pasted.

Looks perfect. Thanks a lot, @chuckpreslar