Sends the TaskStop event to the handlers for it.
334609
@SuppressWarnings("checkstyle:illegalcatch")
  public void afterTaskExit() throws TaskStopHandlerFailure {
    LOG.log(Level.FINEST, "Sending TaskStop event to the registered event handlers.");
    for (final EventHandler<TaskStop> stopHandler : this.taskStopHandlers) {
      try {
        stopHandler.onNext(this.taskStop);
      } catch (final Throwable throwable) {
        throw new TaskStopHandlerFailure(stopHandler, throwable);
      }
    }
    LOG.log(Level.FINEST, "Done sending TaskStop event to the registered event handlers.");
  }
1252006
private void submit(final ActiveContext context) {
    try {
      LOG.log(Level.INFO, "Send task to context: {0}", new Object[]{context});
      if (JobDriver.this.handlerManager.getActiveContextHandler() == 0) {
        throw new RuntimeException("Active Context Handler not initialized by CLR.");
      }
      final ActiveContextBridge activeContextBridge = activeContextBridgeFactory.getActiveContextBridge(context);
      NativeInterop.clrSystemActiveContextHandlerOnNext(JobDriver.this.handlerManager.getActiveContextHandler(),
          activeContextBridge, JobDriver.this.interopLogger);
    } catch (final Exception ex) {
      LOG.log(Level.SEVERE, "Fail to submit task to active context");
      context.close();
      throw new RuntimeException(ex);
    }
  }
598562
function isTaskHandled(request, reply) {
        var taskName = request.query.task;

        // if no task or task handler, don't do anything
        if (!taskName && !taskHandlers[taskName]) { return false; }

        // if task info doesn't have service or method, don't do anything
        var taskInfo = taskHandlers[taskName];
        if (!taskInfo || !taskInfo.service || !taskInfo.method || !taskInfo.service[taskInfo.method]) {
            return false;
        }

        // if user is not logged in redirect to login then back to here
        if (!request.caller || !request.caller.user) {
            var currentUrl = request.url.pathname;
            var loginUrl = currentUrl + '?modal=auth&submodal=login&redirect=' + currentUrl;
            reply().redirect(loginUrl);
            return true;
        }

        // start collecting the service request
        var serviceReq = { caller: request.caller };

        // get the values from the request object to put into the service request
        _.each(taskInfo.params, function (param) {
            if (request.query[param]) {
                serviceReq[param] = request.query[param];
            }
        });

        // call the service method
        taskInfo.service[taskInfo.method](serviceReq)
            .then(function () {
                reply().redirect(request.path + '?notify=' + taskInfo.notifySuccess);
            })
            .catch(function (err) {
                log.error(err);
                reply().redirect(request.path + '?notify=' + taskInfo.notifyFailure);
            });

        return true;
    }
1334151
private void bindEvents() {
		visibilityToggle.addClickHandler(new ClickHandler() {

			public void onClick(ClickEvent event) {
				if (visibilityToggle.isEnabled()) {
					layer.setMarkedAsVisible(!layer.isMarkedAsVisible());
					visibilityToggle.setEnabled(true); // Works because JavaScript is single threaded...
				}
			}
		});
	}
613727
def _send_event_task(args):
    
    endpoint = args['endpoint']
    json_message = args['json_message']
    _consumer_impl.send(endpoint, json_message)
1155661
def _fire_task(self, exclude=None):
        """"""
        connection = mail.get_connection(fail_silently=True)
        # Warning: fail_silently swallows errors thrown by the generators, too.
        connection.open()
        for m in self._mails(self._users_watching(exclude=exclude)):
            connection.send_messages([m])
1166403
private void publishEvent(WSJobExecution objectToPublish, String eventToPublishTo) {
        if (getBatchEventsPublisher() != null) {
            getBatchEventsPublisher().publishJobExecutionEvent(objectToPublish, eventToPublishTo, correlationId);
        }
    }
429884
@Override
    public void taskStopping() {
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "taskStopping", "restore caller/invocation subjects", prevCallerSubject, prevInvocationSubject);

        subjectManager.setCallerSubject(prevCallerSubject);
        subjectManager.setInvocationSubject(prevInvocationSubject);

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "taskStopping");
    }
992076
def send_task(self, task, force=True):
        '''
        
        '''
        try:
            self.out_queue.put_nowait(task)
        except Queue.Full:
            if force:
                self._send_buffer.appendleft(task)
            else:
                raise
576686
def trigger_event(self, event, client, args, force_dispatch=False):
        """"""
        self.controller.process_event(event, client, args, force_dispatch=force_dispatch)
597633
public void setStop(final double STOP) {
        if (null == stop) {
            _stop = STOP;
            fireSectionEvent(UPDATE_EVENT);
        } else {
            stop.set(STOP);
        }
    }
748505
function() {
    firstTaskTimeout = clearTimeout(firstTaskTimeout);
    const task = taskQueue.shift();

    if (task) {
      const conn = idleConnections.shift();
      if (conn) {
        activeConnections[conn.threadId] = conn;
        resetTimeoutToNextTask();
        processTask(conn, task.sql, task.values, task.isBatch)
          .then(task.resolve)
          .catch(task.reject);
      } else {
        taskQueue.unshift(task);
      }
    }
  }
411647
def _send_event_to_all(self, action, event):
        
        for project_listeners in self._listeners.values():
            for listener in project_listeners:
                listener.put_nowait((action, event, {}))
133297
@MainThread
    private void handleTaskFinished(Task task) {
        if (task.method.type != EventMethod.Type.SUBSCRIBE) {
            // We are not interested in finished callbacks, only finished subscriber calls
            return;
        }

        if (task.method.isSingleThread) {
            Utils.log(task, "Single-thread method is no longer in use");
            task.method.isInUse = false;
        }

        Event event = task.event;

        if (!activeEvents.contains(event)) {
            Utils.logE(event.getKey(), "Cannot finish already finished event");
            return;
        }

        ((EventBase) event).handlersCount--;

        if (((EventBase) event).handlersCount == 0) {
            // No more running handlers
            activeEvents.remove(event);
            scheduleStatusUpdates(event, EventStatus.FINISHED);
            executeTasks(false);
        }
    }
1311782
public function sendEvent()
    {

        $this->send('event', [
            'ec' => $this->hit->ec,     // Event Category
            'ea' => $this->hit->ea,     // Event Action
            'el' => $this->hit->el,     // Event Label
            'ev' => $this->hit->ev,     // Event Value
        ]);

    }
391293
protected void dispatchEvents() {

    while (true) {

      Object event = this.eventQueue.poll();
      if (event == null) {
        return;
      }
      Collection<Throwable> errors = new LinkedList<>();
      dispatchEvent(event, errors);
      if (!errors.isEmpty()) {
        handleErrors(errors, event);
      }
    }
  }
867650
@Override
	public void onEvent(TaskEvent event) {
		if (event instanceof TerminationEvent) {
			terminationSignaled = true;
		}
		else if (event instanceof AllWorkersDoneEvent) {
			AllWorkersDoneEvent wde = (AllWorkersDoneEvent) event;
			aggregatorNames = wde.getAggregatorNames();
			aggregates = wde.getAggregates(userCodeClassLoader);
		}
		else {
			throw new IllegalArgumentException("Unknown event type.");
		}

		latch.countDown();
	}