Tell the CCU that we want to receive events
968373
function subscribe() {
    console.log(' > ', 'init', ['xmlrpc_bin://' + thisHost + ':2031', 'test123']);
    rpcClient.methodCall('init', ['xmlrpc_bin://' + thisHost + ':2031', 'test123'], function (err, res) {
        console.log(err, res);
    });
}
1091512
def _on_io_events(self, fd=None, _events=None):
        
        if fd not in self._connections:
            LOGGER.warning('Received IO event for non-existing connection')
            return
        self._poll_connection(fd)
1232325
def _nodedev_event_update_cb(conn, dev, opaque):
    '''
    
    '''
    _salt_send_event(opaque, conn, {
        'nodedev': {
            'name': dev.name()
        },
        'event': opaque['event']
    })
1060138
def process_invite(room, sender, event)
      # Return early if we're already part of this room
      membership = (@memberships[room] ||= {})
      return if membership[:type] == :join
      process_member_event room, event
      broadcast(:invited, self, room, sender)
    end
1078001
def send_venue(self, *args, **kwargs):
        """"""
        return send_venue(*args, **self._merge_overrides(**kwargs)).run()
1331914
def accept(self, event):
        """"""

        self.log('Invitation accepted:', event.__dict__, lvl=debug)
        try:
            uuid = event.data
            enrollment = objectmodels['enrollment'].find_one({
                'uuid': uuid
            })

            if enrollment is not None:
                self.log('Enrollment found', lvl=debug)
                if enrollment.status == 'Open':
                    self.log('Enrollment is still open', lvl=debug)
                    if enrollment.method == 'Invited' and self.config.auto_accept_invited:
                        enrollment.status = 'Accepted'

                        data = 'You should have received an email with your new password ' \
                               'and can now log in to the system and start to use it. <br/>' \
                               'Please change your password immediately after logging in'
                        password = std_human_uid().replace(" ", '')

                        self._create_user(enrollment.name, password, enrollment.email, enrollment.method, uuid)
                        self._send_acceptance(enrollment, password, event)
                    elif enrollment.method == 'Enrolled' and self.config.auto_accept_enrolled:
                        enrollment.status = 'Accepted'
                        data = 'Your account is now activated.'

                        self._create_user(enrollment.name, enrollment.password, enrollment.email, enrollment.method,
                                          uuid)

                        # TODO: Evaluate if sending an acceptance mail makes sense
                        # self._send_acceptance(enrollment, "", event)
                    else:
                        enrollment.status = 'Pending'
                        data = 'Someone has to confirm your enrollment ' \
                               'first. Thank you, for your patience.'
                        # TODO: Alert admin users
                    enrollment.save()

                # Reaffirm acceptance to end user, when clicking on the link multiple times
                elif enrollment.status == 'Accepted':
                    data = 'You can now log in to the system and start to use it.'
                elif enrollment.status == 'Pending':
                    data = 'Someone has to confirm your enrollment ' \
                           'first. Thank you, for your patience.'
                else:
                    self.log('Enrollment has been closed already!', lvl=warn)
                    self._fail(event)
                    return
                packet = {
                    'component': 'hfos.enrol.enrolmanager',
                    'action': 'accept',
                    'data': {True: data}
                }
                self.fireEvent(send(event.client.uuid, packet))
            else:
                self.log('No enrollment available.', lvl=warn)
                self._fail(event)
        except Exception as e:
            self.log('Error during invitation accept handling:', e, type(e),
                     lvl=warn, exc=True)
36658
def notify(cls, user_or_email, instance):
        """"""
        return super(InstanceEvent, cls).notify(user_or_email,
                                                object_id=instance.pk)
858490
def events(self):
        
        events = [self.acknowledge_event] + self.verification_events
        return [x for x in events if x]
1149252
def notify(self, correlation_id, args):
        
        for listener in self._listeners:
            try:
                listener.on_event(correlation_id, self, args)
            except Exception as ex:
                raise InvocationException(
                    correlation_id,
                    "EXEC_FAILED",
                    "Raising event " + self._name + " failed: " + str(ex)
                ).with_details("event", self._name).wrap(ex)
415095
def prepare_dispatches(cls, message, recipients=None):
        
        return Dispatch.create(message, recipients or cls.get_subscribers())
435859
def subscribe_to_human_connection_events(
        self,
        subscriber: Callable[[events.HumanConnectionEvent], None],
    ) -> None:
        
        self._human_connection_subscribers.append(subscriber)
1195364
private Message prepare(String channel, Message message, Recipient[] recipients) {
        message.setMetadata("cwf.pub.node", nodeId);
        message.setMetadata("cwf.pub.channel", channel);
        message.setMetadata("cwf.pub.event", UUID.randomUUID().toString());
        message.setMetadata("cwf.pub.when", System.currentTimeMillis());
        message.setMetadata("cwf.pub.recipients", recipients);
        return message;
    }
868988
def subscribe(hub, callback_url, topic_url, lease_seconds, secret,
              endpoint_hook_data):
    """"""

    for validate in hub.validators:
        error = validate(callback_url, topic_url, lease_seconds, secret,
                         endpoint_hook_data)
        if error:
            send_denied(hub, callback_url, topic_url, error)
            return

    if intent_verified(hub, callback_url, 'subscribe', topic_url,
                       lease_seconds):
        hub.storage[topic_url, callback_url] = {
            'lease_seconds': lease_seconds,
            'secret': secret,
        }
209574
public void offer_change(org.omg.CosNotification.EventType[] added, org.omg.CosNotification.EventType[] removed)
            throws org.omg.CosNotifyComm.InvalidEventType {
        System.out.println("calling EventConsumer.offer_change()");
    }
895910
function(objJoint, arrChainsOfRecipientPrivateElements, arrChainsOfCosignerPrivateElements){
						network.broadcastJoint(objJoint);
						if (!arrChainsOfRecipientPrivateElements && recipient_device_address) // send notification about public payment
							walletGeneral.sendPaymentNotification(recipient_device_address, objJoint.unit.unit);
						handleResult(null, objJoint.unit.unit);
					}
626397
def send_events(self, events):
        
        for event in events:
            self.queue.events.add().MergeFrom(event)
        return None
548509
@Controller
    public void askWhetherToRepeat(WebSocketSession session, Event event) {
        if (event.getText().contains("yes")) {
            reply(session, event, "Great! I will remind you tomorrow before the meeting.");
        } else {
            reply(session, event, "Okay, don't forget to attend the meeting tomorrow :)");
        }
        stopConversation(event);    // stop conversation
    }