- # task list
- # outsiders request operations by putting (fn, args...) tuples on _q
- # the worker thread (created below) will perform these operations in order
- self._q = Queue.Queue(maxsize=4) # keep from overflowing and backing up.
- tools.as_daemon_thread(self._run)
-
- def ensure_created(self, rec):
- """Cause the account specified by <rec> to exist if it doesn't already."""
- if rec.has_key('name'):
- logger.verbose('Worker.ensure_created with name=%s'%rec['name'])
- self._enqueue((self._ensure_created, rec.copy(), Startingup))
- logger.verbose('Worker queue has %d item(s)'%self._q.qsize())
-
- def _ensure_created(self, rec, startingup):