I split up the #each method by taking the poll = ZMQ::Poller.new assignment and moving it into a memoized method, and I also moved the for socket in sockets loop into a method that is called on initialize.
This has the benefit of not having to new up a ZMQ::Poller object and register all sockets any time #each is called on the Flatware Poller class.
A small refactoring of the Poller class.
I split up the #each method by taking the
poll = ZMQ::Poller.new
assignment and moving it into a memoized method, and I also moved thefor socket in sockets
loop into a method that is called on initialize.This has the benefit of not having to new up a
ZMQ::Poller
object and register all sockets any time #each is called on the FlatwarePoller
class.