currently allow direct global state updates from external sources (if you need to, send an event on the bus instead)
977375
private synchronized PipelineInterpreter.State reloadAndSave() {
        // this classloader will hold all generated rule classes
        PipelineClassloader commonClassLoader = allowCodeGeneration ? new PipelineClassloader() : null;

        // read all rules and parse them
        Map<String, Rule> ruleNameMap = Maps.newHashMap();
        ruleService.loadAll().forEach(ruleDao -> {
            Rule rule;
            try {
                rule = pipelineRuleParser.parseRule(ruleDao.id(), ruleDao.source(), false, commonClassLoader);
            } catch (ParseException e) {
                rule = Rule.alwaysFalse("Failed to parse rule: " + ruleDao.id());
            }
            ruleNameMap.put(rule.name(), rule);
        });

        // read all pipelines and parse them
        ImmutableMap.Builder<String, Pipeline> pipelineIdMap = ImmutableMap.builder();
        pipelineService.loadAll().forEach(pipelineDao -> {
            Pipeline pipeline;
            try {
                pipeline = pipelineRuleParser.parsePipeline(pipelineDao.id(), pipelineDao.source());
            } catch (ParseException e) {
                pipeline = Pipeline.empty("Failed to parse pipeline" + pipelineDao.id());
            }
            //noinspection ConstantConditions
            pipelineIdMap.put(pipelineDao.id(), resolvePipeline(pipeline, ruleNameMap));
        });

        final ImmutableMap<String, Pipeline> currentPipelines = pipelineIdMap.build();

        // read all stream connections of those pipelines to allow processing messages through them
        final HashMultimap<String, Pipeline> connections = HashMultimap.create();
        for (PipelineConnections streamConnection : pipelineStreamConnectionsService.loadAll()) {
            streamConnection.pipelineIds().stream()
                    .map(currentPipelines::get)
                    .filter(Objects::nonNull)
                    .forEach(pipeline -> connections.put(streamConnection.streamId(), pipeline));
        }
        ImmutableSetMultimap<String, Pipeline> streamPipelineConnections = ImmutableSetMultimap.copyOf(connections);

        final PipelineInterpreter.State newState = stateFactory.newState(currentPipelines, streamPipelineConnections);
        latestState.set(newState);
        return newState;
    }
574978
def _property_change_event_handler(self, signal, transport, *args):
        
        current_state = self.source.State
        if (self.state == 'connected' and current_state == 'playing'):
            self._acquire_media_transport(transport, 'r')
        elif (self.state == 'playing' and current_state == 'connected'):
            self._release_media_transport(transport, 'r')
        self.state = current_state
713489
function drainEventBusAndTick( done ) {
      // to ensure that done is only called after the promise of updateAreaVisibility was resolved, we ensure
      // that the widget and the testing code wait for the same promise to be resolved before continuing.
      const promise = new Promise( resolve => {
         axMocks.widget.axVisibility.updateAreaVisibility.and.callFake( () => {
            resolve();
            return promise;
         } );
      } );
      return testEventBus.drainAsync()
         .then( () => promise )
         .then( done, done.fail );
   }
206874
function broadcast(event, data, destination) {
        if (!crosstab.supported) {
            notSupported();
        }

        var message = {
            id: util.generateId(),
            event: event,
            data: data,
            destination: destination,
            origin: crosstab.id,
            timestamp: util.now()
        };

        // If the destination differs from the origin send it out, otherwise
        // handle it locally
        if (message.destination !== message.origin) {
            setLocalStorageItem(util.keys.MESSAGE_KEY, message);
        }

        if (!message.destination || message.destination === message.origin) {
            eventHandler.emit(event, message);
        }
    }
759708
function (entering, params, onEnter, updateParams) {
          var inactivatedState = getInactivatedState(entering);
          if (inactivatedState && (updateParams || !getInactivatedState(entering, params))) {
            var savedLocals = entering.locals;
            this.stateExiting(inactivatedState);
            entering.locals = savedLocals;
          }
          entering.self.status = 'entered';

          if (onEnter)
            $injector.invoke(onEnter, entering.self, entering.locals.globals);
        }
1233415
function dispatch(action, payload) {
    if (process.env.NODE_ENV !== 'production' && dispatching) {
      throw new Error(`'${action.toString()}' was dispatched while '${dispatching.toString()}' was still updating. Updaters should be pure functions and must not dispatch actions.`);
    }
    try {
      dispatching = action;
      state = updater(state, action, payload);
      if (process.env.NODE_ENV !== 'production' && debug) {
        console.info(state);
      }
    } finally {
      dispatching = null;
    }
    updateUI();
  }
84328
def notify_state(node, state, latency = nil)
      @lock.synchronize do
        if running?
          update_current_state(node, state, latency)
        end
      end
    rescue => ex
      logger.error("Error handling state report #{[node, state].inspect}: #{ex.inspect}")
      logger.error(ex.backtrace.join("\n"))
    end
497281
function () {
        function checkUpdate() {
            var current = module.exports.current();
            if (current !== last) {
                last = current;
                events.trigger('update', current);
            }
        }

        // Do not run unless breakpoints are available.
        if (!running && breakpoints.length) {
            running = true;
            global.addEventListener('resize', function () {
                if (!working) {
                    working = true;
                    global.requestAnimationFrame(function () {
                        checkUpdate();
                        working = false;
                    });
                }
            });
        }
        checkUpdate();
    }
1232325
def _nodedev_event_update_cb(conn, dev, opaque):
    '''
    
    '''
    _salt_send_event(opaque, conn, {
        'nodedev': {
            'name': dev.name()
        },
        'event': opaque['event']
    })
27520
function(b) {
			var list, checks, handler, isglobal;
			if (b.type === gui.BROADCAST_KEYEVENT) {
				var down = b.data.down,
					type = b.data.type;
				if ((list = (this._trackedtypes[type]))) {
					list.forEach(function(checks) {
						handler = checks[0];
						isglobal = checks[1];
						if (isglobal === b.global) {
							handler.onkey(new gui.Key(down, type, isglobal));
						}
					});
				}
			}
		}
719259
function (event) {
    if (!this.data.enabled) {
      return;
    } else if (!event.type) {
      if (this.data.debug) console.warn('Missing event type.');
    } else if (event.type === 'ping') {
      this.peer.send(event);
    } else {
      this.state[event.type] = event.state;
    }
  }
252280
def _rt_state_update(route_table_id, dcidr, router_ip="(none)",
                     instance_id="(none)", eni_id="(none)",
                     old_router_ip="(none)", msg="(none)"):
    
    buf = "inst: %s, eni: %s, r_ip: %-15s, o_r_ip: %-15s, msg: %s" % \
          (instance_id, eni_id, router_ip, old_router_ip, msg)
    CURRENT_STATE.vpc_state.setdefault('route_tables', {}). \
                            setdefault(route_table_id, {})[dcidr] = buf
1243852
private void pushState(boolean isStatic) {
        stateStack.add(new StateStackElement());
        currentScope = new VariableScope(currentScope);
        currentScope.setInStaticContext(isStatic);
    }
522618
function setupAutoUpdate() {
        updateJsonHandler = new StateHandler(updateJsonPath);
        updateDomain.on('data', receiveMessageFromNode);

        updateDomain.exec('initNode', {
            messageIds: MessageIds,
            updateDir: updateDir,
            requester: domainID
        });
    }
170642
def update_execution_state_kernel(self):
        """"""
        client = self.get_current_client()
        if client is not None:
            executing = client.stop_button.isEnabled()
            self.interrupt_action.setEnabled(executing)
137065
def update(self, other):
        

        self.globals.update(other.globals)
        self.locals.update(other.locals)
        return self
1176969
def sendStatusPing(self):
        
        data = parse.urlencode({"key": self.key, "version": self.version}).encode()
        req = request.Request("https://redunda.sobotics.org/status.json", data)

        response = request.urlopen(req)

        jsonReturned = json.loads(response.read().decode("utf-8"))

        self.location = jsonReturned["location"]
        self.shouldStandby = jsonReturned["should_standby"]
        self.eventCount = jsonReturned["event_count"]