phergie / phergie-irc-bot-react

IRC bot built on React
BSD 2-Clause "Simplified" License
81 stars 26 forks source link

Adds a new EventQueueFactoryAwareInterface for plugins #19

Closed Renegade334 closed 9 years ago

Renegade334 commented 9 years ago

Plugins can now use the event queue factory to resolve connections to event queue instances, for processing asynchronous events without having to store event queue instances or play object ping-pong.

public function handleMyAsynchronousEvent(ConnectionInterface $connection, $message)
{
  $queue = $this->getEventQueueFactory()->getEventQueue($connection);
  $queue->ircPrivmsg($this->myOutputChannel, $message);
}
coveralls commented 9 years ago

Coverage Status

Coverage decreased (-0.6%) to 96.78% when pulling 5d218cbe073b5a8b89e2e171b75e7da06057addb on Renegade334:devel-eventqueue-aware into 2ed099cb73f1d49d2ca20e5f71a3756bcde9e319 on phergie:master.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.69%) to 98.07% when pulling e1bd9061af1d1318f53f5974e0464cc030d0e9e1 on Renegade334:devel-eventqueue-aware into 2ed099cb73f1d49d2ca20e5f71a3756bcde9e319 on phergie:master.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.69%) to 98.07% when pulling e1bd9061af1d1318f53f5974e0464cc030d0e9e1 on Renegade334:devel-eventqueue-aware into 2ed099cb73f1d49d2ca20e5f71a3756bcde9e319 on phergie:master.

elazar commented 9 years ago

Very nice work. We'll need to add this to the wiki and update any plugins that currently maintain their own storage of event queues, such as FeedTicker.

elazar commented 9 years ago

Hm, one minor issue that I missed and Scrutinizer picked up: setEventQueueFactory() uses $queueFactory in the method declaration and $factory in the docblock.

public function setEventQueueFactory(EventQueueFactoryInterface $queueFactory)
* @param \Phergie\Irc\Bot\React\EventQueueFactoryInterface $factory
Renegade334 commented 9 years ago

:-/

Can you ret-con it yourself?

elazar commented 9 years ago

Yup, I'll get it. Thanks.

Edit: Done. c4e857f92d045cd6c879744f1291518714a5ca52

Renegade334 commented 9 years ago

God bless GitHub Mobile.