Skip to content
theepicsnail edited this page Mar 10, 2011 · 2 revisions

The PluginDispatcher is a provided component of SuperBot2. Its purpose is to take in (function,event) tuples, call them on PluginDispatcherWorkerThreads and deliver the results back to the Connector. The Core provides the PluginDispatcher with the function from the Connector through the SetResponseHandler function, the PluginDispatcher does not talk to the Connector directly.

The PluginDispatcher should create a number of PluginDispatcherWorkerThreads, and manage them.

(Function,Event) tuples are given to the PluginDispatcher through the Enqueue(tuple) function. This notifies the PluginDispatcherWorkerThreads to consume them.

Functions

  • SetResponseHandler(func)
  • Enqueue(function,args)
  • Dequeue()
  • Stop()

TODO

  • Make the number of threads configurable
Clone this wiki locally