It is neither supported nor recommended practice to call ec_resume() from within an external predicate, because this would invariably lead to programs which are hard to understand and to get right.
Currently, it is also not possible to post goals from within an external predicate, but that is a sensible programming style and will be supported in forthcoming releases. Posting events however is already possible now.