Registers this module as a worker with the given coordinator.
173615
def register(coordinator):
    """"""
    fetch_queue = Queue.Queue()
    coordinator.register(FetchItem, fetch_queue)
    for i in xrange(FLAGS.fetch_threads):
        coordinator.worker_threads.append(
            FetchThread(fetch_queue, coordinator.input_queue))
396328
function Worker() {
    this.config = JSON.parse(process.env.WORKER_CONFIG);
    if (typeof this.config !== 'object') {
      throw new Error('WORKER_CONFIG is missing');
    }
    process.title = process.variousCluster = this.config.title;
  }
504084
def get_coordinator():
    """"""
    workflow_queue = Queue.Queue()
    complete_queue = Queue.Queue()
    coordinator = WorkflowThread(workflow_queue, complete_queue)
    coordinator.register(WorkflowItem, workflow_queue)
    return coordinator
5887
protected function registerQueueWorker()
    {
        $this->app->singleton('queue.worker', function () {
            if ($this->eye->laravelVersionIs('>=', '5.3.0')) {
                return new Worker($this->app['queue'], $this->app['events'], $this->app[ExceptionHandler::class]);
            } else {
                return new WorkerLegacy($this->app['queue'], $this->app['queue.failer'], $this->app['events']);
            }
        });
    }
687074
def register_handler(queues, opts={}, handler=nil, &block) #:nodoc:
      Array(queues).each do |queue|
        @handlers[queue] = [opts.symbolize_keys, handler || block]
      end
    end
11141
@Bind(optional = true, aggregate = true)
    public synchronized void bindModule(Module module) {
        register(module);
    }
1219543
public static void register(IMalisisMod mod, Object messageHandler)
	{
		register(mod, messageHandler.getClass(), messageHandler);
	}
287219
protected function registerWorker()
	{
		$this->registerWorkCommand();

		$this->app->bindShared('queue.worker', function($app)
		{
			return new Worker($app['queue'], $app['queue.failer'], $app['events']);
		});
	}
154203
protected function registerWorkerExitCallback()
    {
        $this->swooleServer->on('WorkerExit', function ($server, $workerId) {
            $this->events->dispatch(new Events\WorkerExiting($this, $workerId));

            $this->dispatchEvent('WorkerExit', $this, $workerId);
        });
    }
486180
private void registerHandlers() {
        // general
        addHandler(new ReadyHandler(api));
        addHandler(new ResumedHandler(api));

        // server
        addHandler(new GuildBanAddHandler(api));
        addHandler(new GuildBanRemoveHandler(api));
        addHandler(new GuildCreateHandler(api));
        addHandler(new GuildDeleteHandler(api));
        addHandler(new GuildMembersChunkHandler(api));
        addHandler(new GuildMemberAddHandler(api));
        addHandler(new GuildMemberRemoveHandler(api));
        addHandler(new GuildMemberUpdateHandler(api));
        addHandler(new GuildUpdateHandler(api));
        addHandler(new VoiceStateUpdateHandler(api));

        // role
        addHandler(new GuildRoleCreateHandler(api));
        addHandler(new GuildRoleDeleteHandler(api));
        addHandler(new GuildRoleUpdateHandler(api));

        // emoji
        addHandler(new GuildEmojisUpdateHandler(api));

        // channel
        addHandler(new ChannelCreateHandler(api));
        addHandler(new ChannelDeleteHandler(api));
        addHandler(new ChannelPinsUpdateHandler(api));
        addHandler(new ChannelUpdateHandler(api));
        addHandler(new WebhooksUpdateHandler(api));

        // user
        addHandler(new PresencesReplaceHandler(api));
        addHandler(new PresenceUpdateHandler(api));
        addHandler(new TypingStartHandler(api));
        addHandler(new UserUpdateHandler(api));

        // message
        addHandler(new MessageCreateHandler(api));
        addHandler(new MessageDeleteBulkHandler(api));
        addHandler(new MessageDeleteHandler(api));
        addHandler(new MessageUpdateHandler(api));

        // reaction
        addHandler(new MessageReactionAddHandler(api));
        addHandler(new MessageReactionRemoveAllHandler(api));
        addHandler(new MessageReactionRemoveHandler(api));
    }
188002
def register_importer():
    

    def test(importer):
        return importer.__class__.__name__ == ModuleImporterFromVariables.__name__
    already_registered = any([True for i in sys.meta_path if test(i)])

    if not already_registered:
        importer = ModuleImporterFromVariables(
            restrict_to=["SelfWrapper"],
        )
        sys.meta_path.insert(0, importer)

    return not already_registered
1020836
public void registerWorkerStatus(ZooKeeper zk, Plan plan, WorkerStatus s) throws WorkerDaoException{
    String writeToPath = PLAN_WORKERS_ZK + "/" + plan.getName() + "/" + s.getWorkerUuid();
    try {
      Stat planBase = zk.exists(PLAN_WORKERS_ZK + "/" + plan.getName(), false);
      if (planBase == null){
        try {
          zk.create(PLAN_WORKERS_ZK + "/" + plan.getName(), new byte [0] , Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
        } catch (Exception ignore){}
      }
      zk.create(writeToPath, MAPPER.writeValueAsBytes(s), Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
      LOGGER.debug("Registered as ephemeral " + writeToPath);
      zk.exists(PLANS_ZK + "/" + plan.getName(), true); //watch job for events
    } catch (KeeperException | InterruptedException | IOException e) {
      LOGGER.warn(e);
      throw new WorkerDaoException(e);
    }
  }
517287
def register():
    
    try:
        signals.article_generator_init.connect(feed_parser_initialization)
        signals.article_generator_context.connect(fetch_github_activity)
    except ImportError:
        logger.warning('`github_activity` failed to load dependency `feedparser`.'
                       '`github_activity` plugin not loaded.')
900307
def _registerHandler(self, handler):
        
        self._logger.addHandler(handler)
        self._handlers.append(handler)
1198813
private void doAddWorker() {
        if (idleWorkers.get() == 0) {
            synchronized (workers) {
            	if (workers.size() >= getMaximumPoolSize()) {
                    return;
                }
                if (workers.isEmpty() || (idleWorkers.get() == 0)) {
                	addWorkerUnsafe();
                }
            }
        }
    }
525982
protected function registerWorker()
	{
		$this->registerWorkCommand();

		$this->registerRestartCommand();

		$this->app->singleton('queue.worker', function($app)
		{
			return new Worker($app['queue'], $app['queue.failer'], $app['events']);
		});
	}
95497
private void installModule(final Node node, final ModuleContext module, final Handler<AsyncResult<Void>> doneHandler) {
    node.installModule(module.module(), doneHandler);
  }