Publish a TopologyOpenedEvent to all topology listeners.

        :Parameters:
         - `topology_id`: A unique identifier for the topology this server
           is a part of.
339609
def publish_topology_opened(self, topology_id):
        
        event = TopologyOpenedEvent(topology_id)
        for subscriber in self.__topology_listeners:
            try:
                subscriber.opened(event)
            except Exception:
                _handle_exception()
1108546
function(id, socket) {
  EventEmitter.call(this);
  this.id = id;
  this.socket = socket;
  this.remoteAddress = {
    ip: socket.handshake.address.address,
    port: socket.handshake.address.port
  };

  var self = this;

  socket.on('disconnect', this.emit.bind(this, 'disconnect'));

  socket.on('error', this.emit.bind(this, 'error'));

  socket.on('message', function(msg) {
    self.emit('message', msg);
  });

  this.state = ST_INITED;

  // TODO: any other events?
}
841179
def link(event_ids, stream_name:, expected_version: :any)
      repository.link_to_stream(event_ids, Stream.new(stream_name), ExpectedVersion.new(expected_version))
      self
    end
970908
async def publish(self, channel, event, data=None):
        
        msg = {'event': event, 'channel': channel}
        if data:
            msg['data'] = data
        try:
            await self.pubsub.publish(self.prefixed(channel), msg)
        except ConnectionRefusedError:
            self.connection_error = True
            self.logger.critical(
                '%s cannot publish on "%s" channel - connection error',
                self,
                channel
            )
        else:
            self.connection_ok()
45900
def Publish(self, event_name, msg, delay=0):
    """"""
    events_lib.Events.PublishEvent(event_name, msg, delay=delay)
548689
def ext_publish(self, instance, loop, *args, **kwargs):
        
        if self.external_signaller is not None:
            # Assumes that the loop is managed by the external handler
            return self.external_signaller.publish_signal(self, instance, loop,
                                                          args, kwargs)
164077
private void publishEvent(WSJobExecution objectToPublish, String eventToPublishTo, String correlationId) {
        if (eventsPublisher != null) {
            eventsPublisher.publishJobExecutionEvent(objectToPublish, eventToPublishTo, correlationId);
        }
    }
641752
@Override
	public void publish(Event event) {

		// Connected
		if (event instanceof ConnectedEvent) {
			if (status.compareAndSet(STATUS_CONNECTING_1, STATUS_CONNECTING_2)) {

				// First connection is Ok
				return;
			}
			if (status.compareAndSet(STATUS_CONNECTING_2, STATUS_CONNECTED)) {

				// Second connection is Ok
				logger.info("All Redis pub-sub connections estabilished.");
				connected(false);
			}
			return;
		}

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

	}
29507
def register_event(id, info = EMPTY_HASH)
      Notifications.events[id] = Event.new(id, info)
    end
668615
def publish(self, version_id=None):
        
        if not version_id:
            version_id = self.version.id

        target_url = self._client.get_url('VERSION', 'POST', 'publish', {'layer_id': self.id, 'version_id': version_id})
        r = self._client.request('POST', target_url, json={})
        return self._client.get_manager(Publish).create_from_result(r.json())
1182345
def handle_publish(client, data)
      topic_uri, payload, exclude, include = data

      @engine.create_event(client, topic_uri, payload, exclude, include)

      trigger(:publish, client, topic_uri, payload, exclude, include)
    end
134225
def list_event_types(self, publisher_id):
        
        route_values = {}
        if publisher_id is not None:
            route_values['publisherId'] = self._serialize.url('publisher_id', publisher_id, 'str')
        response = self._send(http_method='GET',
                              location_id='db4777cd-8e08-4a84-8ba3-c974ea033718',
                              version='5.0',
                              route_values=route_values)
        return self._deserialize('[EventTypeDescriptor]', self._unwrap_collection(response))
1045597
private void publishEvent(WSJobInstance objectToPublish, String eventToPublishTo, String correlationId) {
        if (eventsPublisher != null) {
            eventsPublisher.publishJobInstanceEvent(objectToPublish, eventToPublishTo, correlationId);
        }
    }
890703
public void initTopology(String topologyName, int delay) {
        if (this.topology != null) {
            // TODO: possible refactor this code later
            System.out.println("Topology has been initialized before!");
            return;
        }
        this.topology = componentFactory.createTopology(topologyName);
    }
1025015
def publish(self, dataset_identifier, content_type="json"):
        '''
        
        '''
        base = _format_old_api_request(dataid=dataset_identifier)
        resource = "{0}/publication.{1}".format(base, content_type)

        return self._perform_request("post", resource)
1203297
def generate_new_id(self):
        
        self.events.append(Event())
        indiv_id = self.indiv_counter
        self.indiv_counter += 1
        return indiv_id
1089222
def listener_create_event(self, listener_info):
        
        listener_data = listener_info.get('listener')
        lb_list = listener_data.get('loadbalancers')
        for lb in lb_list:
            lb_id = lb.get('id')
            req = dict(instance_id=(lb_id.replace('-', '')))
            instances = self.get_vms_for_this_req(**req)
            if not instances:
                lb_info = self.neutronclient.show_loadbalancer(lb_id)
                if lb_info:
                    port_id = lb_info["loadbalancer"]["vip_port_id"]
                    self.add_lbaas_port(port_id, lb_id)
            else:
                LOG.info("lbaas port for lb %s already added" % lb_id)