Publish the portlet render event
511273
protected void publishRenderEvent(
            IPortletWindow portletWindow,
            HttpServletRequest httpServletRequest,
            RenderPart renderPart,
            long executionTime,
            boolean cached) {

        final IPortletWindowId portletWindowId = portletWindow.getPortletWindowId();

        // Determine if the portlet was targeted
        final IPortalRequestInfo portalRequestInfo =
                this.urlSyntaxProvider.getPortalRequestInfo(httpServletRequest);
        final boolean targeted =
                portletWindowId.equals(portalRequestInfo.getTargetedPortletWindowId());

        renderPart.publishRenderExecutionEvent(
                this.portalEventFactory,
                this,
                httpServletRequest,
                portletWindowId,
                executionTime,
                targeted,
                cached);
    }
396028
protected IPortletRenderExecutionWorker startPortletRenderInternal(
            IPortletWindowId portletWindowId,
            HttpServletRequest request,
            HttpServletResponse response) {
        // first check to see if there is a Throwable in the session for this IPortletWindowId
        final Map<IPortletWindowId, Exception> portletFailureMap = getPortletErrorMap(request);
        final Exception cause = portletFailureMap.remove(portletWindowId);

        final IPortletRenderExecutionWorker portletRenderExecutionWorker;
        if (null != cause) {
            // previous action failed, dispatch to errorPortlet immediately
            portletRenderExecutionWorker =
                    this.portletWorkerFactory.createFailureWorker(
                            request, response, portletWindowId, cause);
        } else {
            IPortletWindow portletWindow =
                    portletWindowRegistry.getPortletWindow(request, portletWindowId);
            IPortletDefinition portletDef = portletWindow.getPortletEntity().getPortletDefinition();
            if (portletDef.getLifecycleState().equals(PortletLifecycleState.MAINTENANCE)) {
                // Prevent the portlet from rendering;  replace with a helpful "Out of Service"
                // message
                portletRenderExecutionWorker =
                        this.portletWorkerFactory.createFailureWorker(
                                request, response, portletWindowId, new MaintenanceModeException());
            } else {
                // Happy path
                portletRenderExecutionWorker =
                        this.portletWorkerFactory.createRenderWorker(
                                request, response, portletWindowId);
            }
        }

        portletRenderExecutionWorker.submit();

        final Map<IPortletWindowId, IPortletRenderExecutionWorker> portletRenderingMap =
                this.getPortletRenderingMap(request);
        portletRenderingMap.put(portletWindowId, portletRenderExecutionWorker);

        return portletRenderExecutionWorker;
    }
682623
function() {
        this.cal.beforeRenderNavEvent.fire();
        if (!this.__rendered) {
            this.createNav();
            this.createMask();
            this.applyListeners();
            this.__rendered = true;
        }
        this.cal.renderNavEvent.fire();
    }
886391
function render(handler, define, parameter) {

  handler.res.render(define.template, Object.assign(parameter, define.parameter), (err, str) => {
    if (err) {
      return handler.req.next(err);
    }

    str = str.replace(/(src=\"\/static\/.*)\"/g, `$1?stamp=${config.app.stamp}"`);
    str = str.replace(/(href=\"\/static\/.*)\"/g, `$1?stamp=${config.app.stamp}"`);
    handler.res.send(str);
  });
}
1038504
function publishEvent( channelName, eventObj ) {
  var broker = getEventBroker( 'main' )
  eventObj.channel = channelName
  broker.publish( eventObj ); 
}
1068643
function render(event) {
    var tooltip = document.createElement('div')
      , element = $(event.element)
      , pos = element.get('data-placement')
      , offset = this.offset(event.element)
      , placement;

    //
    // Create the tooltip with the proper content and insert.
    //
    tooltip.id = "tooltip";
    tooltip.innerHTML = element.get('data-content');
    tooltip.className = ['animated', 'tooltip', 'fadeIn', pos].concat(
      element.get('data-color')
    ).filter(Boolean).join(' ');

    document.body.appendChild(tooltip);

    //
    // Update the position of the tooltip.
    //
    placement = this.placement(pos, tooltip, event.element);
    tooltip.setAttribute('style', [
      'left:' + (offset.left + placement.left) + 'px',
      'top:' + (offset.top + placement.top) + 'px'
    ].join(';'));
  }
856215
function emitAndFire(widget, eventName, eventArg) {
    const originalEmit = widget.emit;
    let event;
    if ('CustomEvent' in window && typeof window.CustomEvent === 'function') {
        event = new CustomEvent(eventName, { detail: eventArg });
    } else {
        event = document.createEvent('CustomEvent');
        event.initCustomEvent(eventName, true, true, eventArg);
    }
    widget.el.dispatchEvent(event);
    originalEmit.call(widget, eventName, eventArg);
}
677765
function publish() {
  console.log('Client ' + clientId + ' is publishing to topic ' + topics.publish);
  // client.on('message',()=>{});
  // this is just for testing purpouse
  // maybe we dont need to stop and start publishing
  var timer = setInterval(function () {
    client.publish(topics.publish, 'ping');
    if (stopPub === true) {
      clearInterval(timer);
      stopPub = false;
    }
  }, 1000);
}
1151038
def publish(self, key, data):
        '''
        
        '''
        publish_data = {key: data}
        self.handler.send(salt.utils.json.dumps(publish_data), False)
1019818
def __on_publish(self, client, userdata, mid):
        # pylint: disable=W0613
        
        try:
            self.__in_flight[mid].set()
        except KeyError:
            pass
978210
function renderDynamicRoute(pageId) {
  return (req, res) => {
    const hrStart = process.hrtime(),
      site = res.locals.site,
      pageUri = `${getExpressRoutePrefix(site)}/_pages/${pageId}@published`;

    return module.exports.renderPage(pageUri, req, res, hrStart);
  };
}
611807
@Override
    public boolean isPortletRenderRequested(
            IPortletWindowId portletWindowId,
            HttpServletRequest request,
            HttpServletResponse response) {
        final Map<IPortletWindowId, IPortletRenderExecutionWorker> portletRenderingMap =
                this.getPortletRenderingMap(request);
        final IPortletRenderExecutionWorker tracker = portletRenderingMap.get(portletWindowId);

        return tracker != null;
    }
1022131
async function publish(props) {
	const message = getData(props)
	return createClient()
		.post('/publish/', {
			json: true,
			body: message
		})
}
402803
function onRender() {
      try {

        // Setup the layer-sender-name
        if (this.nodes.sender) {
          this.nodes.sender.innerHTML = this.item.sender.displayName;
        }

        if (this.nodes.avatar) {
          this.nodes.avatar.users = [this.item.sender];
        }

        // Setup the layer-date
        if (this.nodes.date && !this.item.isNew()) {
          if (this.dateRenderer) this.nodes.date.dateRenderer = this.dateRenderer;
          this.nodes.date.date = this.item.sentAt;
        }

        // Setup the layer-message-status
        if (this.nodes.status && this.messageStatusRenderer) {
          this.nodes.status.messageStatusRenderer = this.messageStatusRenderer;
        }

        // Setup the layer-delete
        if (this.nodes.delete) {
          this.nodes.delete.enabled = this.getDeleteEnabled ? this.getDeleteEnabled(this.properties.item) : true;
        }

        // Generate the renderer for this Message's MessageParts.
        this._applyContentTag();

        // Render all mutable data
        this.onRerender();
      } catch (err) {
        logger.error('layer-message-item.render(): ', err);
      }
    }
338356
@SuppressWarnings("unchecked")
	@Override
	public void publishEvent(ApplicationEvent event) {

		if (event instanceof MappingContextEvent) {
			this.schmeaCreator
					.onApplicationEvent((MappingContextEvent<SolrPersistentEntity<?>, SolrPersistentProperty>) event);
		}
	}
793053
@Override
	public void publish(Event event) {

		// Check state
		if (status.get() == STATUS_STOPPED) {
			return;
		}

		// Connected
		if (event instanceof ConnectedEvent) {
			if (status.compareAndSet(STATUS_CONNECTING, STATUS_CONNECTED)) {

				// Redis connection is Ok
				logger.info("Redis get-set connection are estabilished.");
			}
			return;
		}

		// Disconnected
		if (event instanceof DisconnectedEvent) {
			int s = status.getAndSet(STATUS_DISCONNECTED);
			if (s != STATUS_DISCONNECTED) {
				logger.info("Redis get-set connection aborted.");
				reconnect();
			}
		}

	}
1305062
protected PortletRenderResult doRenderReplayCachedContent(
            IPortletWindow portletWindow,
            HttpServletRequest httpServletRequest,
            CacheState<CachedPortletData<PortletRenderResult>, PortletRenderResult> cacheState,
            PortletOutputHandler portletOutputHandler,
            RenderPart renderPart,
            long baseExecutionTime)
            throws IOException {

        enforceConfigPermission(httpServletRequest, portletWindow);

        logger.debug(
                "Replaying cached content for Render {} request to {}", renderPart, portletWindow);

        final long renderStartTime = System.nanoTime();

        final CachedPortletData<PortletRenderResult> cachedPortletData =
                cacheState.getCachedPortletData();
        cachedPortletData.replay(portletOutputHandler);

        final long executionTime = baseExecutionTime + (System.nanoTime() - renderStartTime);

        publishRenderEvent(portletWindow, httpServletRequest, renderPart, executionTime, true);

        final PortletRenderResult portletResult = cachedPortletData.getPortletResult();
        return new PortletRenderResult(portletResult, executionTime);
    }