So, because I develop Valkyrie I have to consider all of the consequences of allowing external code and callbacks. One of the issues I've run into is that I have a callback which can be run before events to cancel them, but the callback mustn't yield so that the event connections can be fired off at the same time as the event is fired off.
How am I able to detect if a function would yield in this case, without having to actually wait through a yield? My original thoughts were to use pcall, but I've been told that pcall was changed a while ago to accept yielding just as ypcall did.
As a side note, using it as a callback for a C function has been considered however I need the returns from the callbacks to be returned back through the source function. Tricky.

3 comments
I know how to use coroutines but I don't see the usefulness in this case where I need the callback to be a blocking action.
This probably will not help but any way, http://wiki.roblox.com/index.php?title=Beginners_Guide_to_Coroutines and http://wiki.roblox.com/index.php?title=Function_dump/Coroutine_manipulation
you went to school right? then you should know the answer