Moves disconnecting event handlers up a level so adaptors/drivers don't have to
worry about it.
Now, Adaptor/Driver subclasses should simply execute the provided callback to
dindicate they're done disconnecting, rather than calling the superclass method
as before.
* dev:
Remove `self` references in favor of #bind
Stop using #fetch here for now, it just breaks tests
Just use arguments directly instead of array
Remove Utils#bind in preference of built-in fn
Consolidate logstring generation into private fn
Experiment with Utils.fetch in Driver class
Add #fetch Utility function
Fix JSHint errors
Fix an edge case and improve tests for API
This change gives adaptors/drivers more flexibility in halting. Additionally,
now, by default, all Adaptors/Drivers will remove all their event listeners
before halting, which should prevent some additional commands from being sent to
the adaptor during shutdown.
These events are being removed, as they're essentially useless in most cases, as
the events will already have been emitted before the work block is run to set up
handlers for them.
This commit reframes the Utils module to be more self-contained, and now only
the Number prototype methods and the every/after/constantly methods are exposed
globally.
I'm unsure about whether these methods can be more scoped such that people can
turn them off if they want, but that's potentially something to look into in the
future.
This commit also updates most of the other source files in Cylon, requiring the
Utils module rather than assuming the methods are in the global namespace.
A similar batch of commits will need to be made for all other Cylon modules to
make sure they don't explode when they can't find #subclass or something like
that.
To make the previously-global methods available, both in submodules and for
people looking for them, all the utility functions are exported in Cylon.Utils.