Update canvas and handle all events in the gtk queue

        :param bool trigger_update: Whether to call update_now() or not
162761
def wait_for_update(self, trigger_update=False):
        
        if trigger_update:
            self.update_now()

        from gi.repository import Gtk
        from gi.repository import GLib
        from threading import Event
        event = Event()

        # Handle all events from gaphas, but not from gtkmvc3
        # Make use of the priority, which is higher for gaphas then for gtkmvc3
        def priority_handled(event):
            event.set()
        priority = (GLib.PRIORITY_HIGH_IDLE + GLib.PRIORITY_DEFAULT_IDLE) / 2
        # idle_add is necessary here, as we do not want to block the user from interacting with the GUI
        # while gaphas is redrawing
        GLib.idle_add(priority_handled, event, priority=priority)
        while not event.is_set():
            Gtk.main_iteration()
651520
def _trigger_event(self, event):
    

    if event is None or event not in self.__listeners:
      raise ValueError('invalid event type: {0!r}'.format(event))

    # Check the event has not already been triggered, then mark
    # the event as triggered.
    if event in self.__event_set:
      raise RuntimeError('event already triggered: {0!r}'.format(event))
    self.__event_set.add(event)
    listeners = self.__listeners[event] + self.__listeners[None]

    # Remove one-off listeners.
    self.__listeners[event][:] = (l for l in self.__listeners[event] if not l.once)
    self.__listeners[None][:] = (l for l in self.__listeners[None] if not l.once)

    for listener in listeners:
      # XXX: What to do on exceptions? Catch and make sure all listeners
      # run through? What to do with the exception(s) then?
      listener.callback(self, event)
515669
def trigger(self, event, **kwargs):
        
        with self._handlers.trigger_mutex:
            event = prime_event(event, self.__class__.__name__, **kwargs)

            for handler in self._handlers.async_handlers[event]:
                asynchronous(handler, event)
            for handler in self._handlers.sync_handlers[event]:
                synchronous(handler, event)
367157
def trigger_pull(queue, ignore_listener=False, trigger=_c.FSQ_TRIGGER):
    ''''''
    fd = None
    trigger_path = fsq_path.trigger(queue, trigger=trigger)
    _queue_ok(os.path.dirname(trigger_path))
    try:
        fd = os.open(trigger_path,
                     os.O_NDELAY|os.O_NONBLOCK|os.O_APPEND|os.O_WRONLY)
        os.write(fd, '\0')
    except (OSError, IOError, ), e:
        if e.errno != errno.ENXIO:
            if e.errno != errno.EAGAIN and e.errno != errno.EWOULDBLOCK:
                raise FSQTriggerPullError(e.errno, wrap_io_os_err(e))
        elif not ignore_listener:
            raise FSQTriggerPullError(e.errno, u'No listener for:'\
                                      u' {0}'.format(trigger_path))
    finally:
        if fd is not None:
            os.close(fd)
172289
def _trigger_events(view_obj, events_map, additional_kw=None):
    
    if additional_kw is None:
        additional_kw = {}

    event_kwargs = _get_event_kwargs(view_obj)
    if event_kwargs is None:
        return

    event_kwargs.update(additional_kw)
    event_cls = _get_event_cls(view_obj, events_map)
    event = event_cls(**event_kwargs)
    view_obj.request.registry.notify(event)
    return event
657090
def trigger(self_, *param_names):
        
        events = self_.self_or_cls.param._events
        watchers = self_.self_or_cls.param._watchers
        self_.self_or_cls.param._events  = []
        self_.self_or_cls.param._watchers = []
        param_values = dict(self_.get_param_values())
        params = {name: param_values[name] for name in param_names}
        self_.self_or_cls.param._TRIGGER = True
        self_.set_param(**params)
        self_.self_or_cls.param._TRIGGER = False
        self_.self_or_cls.param._events = events
        self_.self_or_cls.param._watchers = watchers
1341435
def main_update(self):
		
		# Renice updater thread to limit overload
		try:
			os.nice(1)
		except AttributeError as er:
			pass # os.nice is not available on windows
		time.sleep(self.refresh)

		try:
			while True:
				# We pick a timestamp to take in account the time used by update()
				timestamp=time.time()

				# Update data with user's defined function
				self.update()

				# We use this trick because we cannot use signals in a backoffice threads
				# and alarm() mess up with readline() in the main thread.
				delay=(timestamp+self.refresh)-time.time()
				if delay > 0:
					if delay > self.refresh:
						time.sleep(self.refresh)
					else:
						time.sleep(delay)

				# Commit change exactly every 'refresh' seconds, whatever update() takes long.
				# Commited values are a bit old, but for RRD, punctuals values
				# are better than fresh-but-not-time-constants values.
				self.commit()

		except Exception as e:
			self.error=e
			raise
461340
def trigger(queue, user=None, group=None, mode=None, trigger=_c.FSQ_TRIGGER):
    ''''''
    # default our owners and mode
    user, group, mode = _dflts(user, group, mode)
    trigger_path = fsq_path.trigger(queue, trigger=trigger)
    created = False
    try:
        # mkfifo is incapable of taking unicode, coerce back to str
        try:
            os.mkfifo(trigger_path.encode(_c.FSQ_CHARSET), mode)
            created = True
        except (OSError, IOError, ), e:
            # if failure not due to existence, rm and bail
            if e.errno != errno.EEXIST:
                raise e

        # don't open and fchown here, as opening WRONLY without an open
        # reading fd will hang, opening RDONLY will zombie if we don't
        # flush, and intercepts triggers meant to go elsewheres
        os.chmod(trigger_path, mode)
        if user is not None or group is not None:
            os.chown(trigger_path, *uid_gid(user, group, path=trigger_path))
    except (OSError, IOError, ), e:
        # only rm if we created and failed, otherwise leave it and fail
        if created:
            _cleanup(trigger_path, e)
        _raise(trigger_path, e)
58827
async def trigger(self, action, args):
        
        if 'update' not in action \
                and 'error' not in action \
                and action.startswith('pre_process'):
            locale = await self.get_user_locale(action, args)
            self.ctx_locale.set(locale)
            return True
325523
def trigger(self, **event):
        

        if not event:
            raise ValueError("tried to trigger nothing")
        for hook in self.hooks:
            if hook.matches(event):
                hook.execute(self, event)
129065
def execute_update(self, update, safe=False):
		''' 
		'''

		# safe = self.safe
		# if update.safe is not None:
		#     safe = remove.safe

		assert len(update.update_data) > 0
		self.queue.append(UpdateOp(self.transaction_id, self, update.query.type, safe, update))
		if self.autoflush:
			return self.flush()
165892
def add_trigger(self, trigger):
        
        # Make sure triggers are re-sorted before a new reply can be requested
        self.sorted = False

        # If no trigger with this priority level has been defined yet, create a new list
        if trigger.priority not in self._triggers:
            self._triggers[trigger.priority] = [trigger]
            return

        # Otherwise, add this trigger to an existing priority list
        self._triggers[trigger.priority].append(trigger)
1067533
def update_callback
      @update_proc.call

      # Accept and eval commands if in console mode
      if @console
        if STDIN.ready?
          cmd = STDIN.gets
          begin
            res = eval(cmd, TOPLEVEL_BINDING)
            STDOUT.puts "=> #{res.inspect}"
            STDOUT.flush
          rescue SyntaxError => se
            STDOUT.puts se
            STDOUT.flush
          rescue Exception => e
            STDOUT.puts e
            STDOUT.flush
          end
        end
      end

    end
25334
async def process_update(self, update: types.Update):
        
        types.Update.set_current(update)

        try:
            if update.message:
                types.User.set_current(update.message.from_user)
                types.Chat.set_current(update.message.chat)
                return await self.message_handlers.notify(update.message)
            if update.edited_message:
                types.User.set_current(update.edited_message.from_user)
                types.Chat.set_current(update.edited_message.chat)
                return await self.edited_message_handlers.notify(update.edited_message)
            if update.channel_post:
                types.Chat.set_current(update.channel_post.chat)
                return await self.channel_post_handlers.notify(update.channel_post)
            if update.edited_channel_post:
                types.Chat.set_current(update.edited_channel_post.chat)
                return await self.edited_channel_post_handlers.notify(update.edited_channel_post)
            if update.inline_query:
                types.User.set_current(update.inline_query.from_user)
                return await self.inline_query_handlers.notify(update.inline_query)
            if update.chosen_inline_result:
                types.User.set_current(update.chosen_inline_result.from_user)
                return await self.chosen_inline_result_handlers.notify(update.chosen_inline_result)
            if update.callback_query:
                if update.callback_query.message:
                    types.Chat.set_current(update.callback_query.message.chat)
                types.User.set_current(update.callback_query.from_user)
                return await self.callback_query_handlers.notify(update.callback_query)
            if update.shipping_query:
                types.User.set_current(update.shipping_query.from_user)
                return await self.shipping_query_handlers.notify(update.shipping_query)
            if update.pre_checkout_query:
                types.User.set_current(update.pre_checkout_query.from_user)
                return await self.pre_checkout_query_handlers.notify(update.pre_checkout_query)
            if update.poll:
                return await self.poll_handlers.notify(update.poll)
        except Exception as e:
            err = await self.errors_handlers.notify(update, e)
            if err:
                return err
            raise
226509
function (is_update) {
            this.no_diapason = false;
            this.coords.p_step = this.convertToPercent(this.options.step, true);

            this.target = "base";

            this.toggleInput();
            this.append();
            this.setMinMax();

            if (is_update) {
                this.force_redraw = true;
                this.calc(true);

                // callbacks called
                this.callOnUpdate();
            } else {
                this.force_redraw = true;
                this.calc(true);

                // callbacks called
                this.callOnStart();
            }

            this.updateScene();
        }
673406
def trigger(self, event, *args):
        """"""
        for handler in self._event_handlers[event]:
            handler(*args)
1031371
function update() {
	connection = new Connection(room)
	// set our funcitonal code on the ready event, so we are sure that the socket has been created and is connected to the server
	connection.on('ready', _ => {
		connection.on('snapshot-event', event => {
			// get every listener including bots and lurkers
			userList = event.data.listing.sort()
			render(userList)
			connection.close()
		})
	})
}