Need an option to disable concurrent function calls
zhaoyeming opened this issue · 4 comments
zhaoyeming commented
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.
chuckpreslar commented
I'll get this feature implemented at some point this week, @zhaoyeming.
zhaoyeming commented
Thanks, @chuckpreslar
chuckpreslar commented
@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.
zhaoyeming commented
Looks perfect. Thanks a lot, @chuckpreslar