Plugins' top-level .setup, .initialise, .reload and .teardown functions have mixin-generated wrappers in the form of IRCPlugin.{setup,initialise,reload,teardown}. These are in place to expose said top-level functions to other parts of the program.
In many cases these functions need Fiber functionality, and ended up individually containing manual Fiber management.
This PR makes the generated wrappers instead always construct a Fiber and then call the original function from inside of it. It also removes the ad-hoc solutions from the plugins that were hitherto doing Fibers manually, to complete the migration.
This does not affect .tick, as it is by nature not meant to suspend by delaying or awaiting. Some handlers that would have been run too often (and created a disproportional number of Fibers) were also excluded, such as onAnyEvent-style handlers, and such being indiscriminately invoked on all IRCEvent.Type.CHAN events.
Plugins' top-level
.setup
,.initialise
,.reload
and.teardown
functions have mixin-generated wrappers in the form ofIRCPlugin.{setup,initialise,reload,teardown}
. These are in place to expose said top-level functions to other parts of the program.In many cases these functions need Fiber functionality, and ended up individually containing manual Fiber management.
This PR makes the generated wrappers instead always construct a Fiber and then call the original function from inside of it. It also removes the ad-hoc solutions from the plugins that were hitherto doing Fibers manually, to complete the migration.
This does not affect
.tick
, as it is by nature not meant to suspend by delaying or awaiting. Some handlers that would have been run too often (and created a disproportional number of Fibers) were also excluded, such asonAnyEvent
-style handlers, and such being indiscriminately invoked on allIRCEvent.Type.CHAN
events.