How to use the crossbar.adminwebmodule.uris.URI_EVENT function in crossbar

To help you get started, we’ve selected a few crossbar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github crossbario / crossbar / v1 / crossbar / fakeos / netstat.py View on Github external
def dispatchEvent(self, event):
      if self.services.has_key("adminws"):
         self.services["adminws"].dispatchAdminEvent(URI_EVENT + "on-netstat", event)
github crossbario / crossbar / v1 / crossbar / bridge / pgremoter.py View on Github external
class PgRemoter(DbRemoter):
   """
   Implements remoting of PostgreSQL stored procedures.
   """

   SERVICENAME = "PostgreSQL Remoter"

   LOGID = "PgRemoter"
   REMOTERID = "pg"

   REMOTE_ID_BASEURI = URI_PGREMOTE

   REMOTER_STATE_CHANGE_EVENT_URI = URI_EVENT + "on-pgremoter-statechange"
   STATS_EVENT_URI = URI_EVENT + "on-pgremoterstat"


   def recache(self, txn):
      """
      Recache PostgreSQL database remotes.

      Recaching is triggered from the following classes:

         - PgRemotes
         - PgConnects
         - AppCreds
      """
      log.msg("PgRemoter.recache")

      txn.execute("""
         SELECT
github crossbario / crossbar / v1 / crossbar / linux / netstat.py View on Github external
def dispatchEvent(self, event):
      if self.services.has_key("adminws"):
         self.services["adminws"].dispatchAdminEvent(URI_EVENT + "on-netstat", event)
github crossbario / crossbar / v1 / crossbar / bridge / extdirectremoter.py View on Github external
and RPC forwarding for Ext.Direct.

   TODO: Cookies!
   """

   USER_AGENT = "crossbar.io"
   """
   User agent provided in HTTP header for requests issued.
   """

   SERVICENAME = "Ext.Direct Remoter"

   REMOTE_ID_BASEURI = URI_EXTDIRECTREMOTE

   REMOTER_STATE_CHANGE_EVENT_URI = URI_EVENT + "on-extdirectremoter-statechange"
   STATS_EVENT_URI = URI_EVENT + "on-extdirectremoterstat"


   def startService(self):
      Remoter.startService(self)

      ## HTTP connection pools indexed by Ext.Direct Remote ID.
      ## Note that we usually do NOT want to recreate those on mere recaches
      ## since that would unnecessarily drop all currently kept alive connections.
      self.httppools = {}

      ## immedialy cache
      self.dbpool.runInteraction(self.recache)


   def recache(self, txn):
      """
github crossbario / crossbar / v1 / crossbar / bridge / pgpusher.py View on Github external
class PgPusher(DbPusher):
   """
   PostgreSQL Pusher Service.

   For each PostgreSQL Connect with >0 push rules, spawn 1 background pusher thread.
   """

   SERVICENAME = "PostgreSQL Pusher"

   LOGID = "PgPusher"

   CONNECT_ID_BASEURI = URI_PGCONNECT

   PUSHER_STATE_CHANGE_EVENT_URI = URI_EVENT + "on-pgpusher-statechange"
   STATS_EVENT_URI = URI_EVENT + "on-pgpusherstat"

   def makeConnect(self, r):
      ## called from DbPusher base class to create database connect instances
      return PgConnect(r[0], r[1], r[2], r[3], r[4], r[5], r[6])

   def makeRule(self, r):
      ## called from DbPusher base class to create push rule instances
      return PgPushRule(r[0], r[1], r[2], r[3], r[4])

   def makeClient(self, connect):
      ## called from DbPusher base class to create background push client instances
      return PgPushClient(self, connect, False)

   def recache(self, txn):
      log.msg("PgPusher.recache")
github crossbario / crossbar / v1 / crossbar / bridge / hanapusher.py View on Github external
class HanaPusher(DbPusher):
   """
   SAP HANA Pusher Service.

   For each SAP HANA Connect with >0 push rules, spawn 1 background pusher thread.
   """

   SERVICENAME = "SAP HANA Pusher"

   LOGID = "HanaPusher"

   CONNECT_ID_BASEURI = URI_HANACONNECT

   PUSHER_STATE_CHANGE_EVENT_URI = URI_EVENT + "on-hanapusher-statechange"
   STATS_EVENT_URI = URI_EVENT + "on-hanapusherstat"

   def makeConnect(self, r):
      ## called from DbPusher base class to create database connect instances
      return HanaConnect(r[0], r[1], r[2], r[3], r[4], r[5], r[6])

   def makeRule(self, r):
      ## called from DbPusher base class to create push rule instances
      return HanaPushRule(r[0], r[1], r[2], r[3], r[4])

   def makeClient(self, connect):
      ## called from DbPusher base class to create background push client instances
      return HanaPushClient(self, connect, False)

   def recache(self, txn):
      log.msg("HanaPusher.recache")
github crossbario / crossbar / v1 / crossbar / netservice / hubwebresource.py View on Github external
def publishStats(self):
      if self.statsChanged:
         self.services["adminws"].dispatchAdminEvent(URI_EVENT + "on-restpusherstat", [self.stats])
         self.statsChanged = False
      self.reactor.callLater(0.2, self.publishStats)
github crossbario / crossbar / v1 / crossbar / linux / vmstat.py View on Github external
def dispatchEvent(self, event):
      if self.services.has_key("adminws"):
         self.services["adminws"].dispatchAdminEvent(URI_EVENT + "on-vmstat", event)
github crossbario / crossbar / v1 / crossbar / freebsd / vmstat.py View on Github external
def dispatchEvent(self, event):
      if self.services.has_key("adminws"):
         self.services["adminws"].dispatchAdminEvent(URI_EVENT + "on-vmstat", event)
github crossbario / crossbar / v1 / crossbar / bridge / restremoter.py View on Github external
Provides a model cache for REST remotes and actual RPC forwarding for REST.

   TODO: Cookies!
   """

   USER_AGENT = "crossbar.io"
   """
   User agent provided in HTTP header for requests issued.
   """

   SERVICENAME = "REST Remoter"

   REMOTE_ID_BASEURI = URI_RESTREMOTE

   REMOTER_STATE_CHANGE_EVENT_URI = URI_EVENT + "on-restremoter-statechange"
   STATS_EVENT_URI = URI_EVENT + "on-restremoterstat"


   def startService(self):
      Remoter.startService(self)

      ## HTTP connection pools indexed by Ext.Direct Remote ID.
      ## Note that we usually do NOT want to recreate those on mere recaches
      ## since that would unnecessarily drop all currently kept alive connections.
      self.httppools = {}

      ## immediately cache
      self.dbpool.runInteraction(self.recache)


   def recache(self, txn):
      """