def __init__(self, router, options): """ :param router: The router this dealer is part of. :type router: Object that implements :class:`autobahn.wamp.interfaces.IRouter`. :param options: Router options. :type options: Instance of :class:`autobahn.wamp.types.RouterOptions`. """ self._router = router self._options = options or types.RouterOptions() ## map: session -> set(registration) ## needed for removeSession self._session_to_registrations = {} ## map: session_id -> session ## needed for exclude/eligible self._session_id_to_session = {} ## map: procedure -> (registration, session) self._procs_to_regs = {} ## map: registration -> procedure self._regs_to_procs = {} ## pending callee invocation requests self._invocations = {} ## check all procedure URIs with strict rules self._option_uri_strict = self._options.uri_check == types.RouterOptions.URI_CHECK_STRICT ## supported features from "WAMP Advanced Profile" self._role_features = role.RoleDealerFeatures(caller_identification = True, progressive_call_results = True)
def __init__(self, router, options=None): """ :param router: The router this dealer is part of. :type router: Object that implements :class:`crossbar.router.interfaces.IRouter`. :param options: Router options. :type options: Instance of :class:`crossbar.router.types.RouterOptions`. """ self._router = router self._options = options or RouterOptions() # generator for WAMP request IDs self._request_id_gen = util.IdGenerator() # registration map managed by this dealer self._registration_map = UriObservationMap(ordered=True) # map: session -> set of registrations (needed for detach) self._session_to_registrations = {} # pending callee invocation requests self._invocations = {} # check all procedure URIs with strict rules self._option_uri_strict = self._options.uri_check == RouterOptions.URI_CHECK_STRICT # supported features from "WAMP Advanced Profile" self._role_features = role.RoleDealerFeatures( caller_identification=True, pattern_based_registration=True, session_meta_api=True, registration_meta_api=True, shared_registration=True, progressive_call_results=True, registration_revocation=True)
def __init__(self, router, options=None): """ :param router: The router this dealer is part of. :type router: Object that implements :class:`crossbar.router.interfaces.IRouter`. :param options: Router options. :type options: Instance of :class:`crossbar.router.types.RouterOptions`. """ self._router = router self._options = options or RouterOptions() # generator for WAMP request IDs self._request_id_gen = util.IdGenerator() # registration map managed by this dealer self._registration_map = UriObservationMap(ordered=True) # map: session -> set of registrations (needed for detach) self._session_to_registrations = {} # map: session -> in-flight invocations self._callee_to_invocations = {} # BEWARE: this map must be kept up-to-date along with the # _invocations map below! Use the helper methods # _add_invoke_request and _remove_invoke_request # map: session -> in-flight invocations self._caller_to_invocations = {} # careful here: the 'request' IDs are unique per-session # (only) so we map from (session_id, call) tuples to in-flight invocations # map: (session_id, call) -> in-flight invocations self._invocations_by_call = {} # pending callee invocation requests self._invocations = {} # check all procedure URIs with strict rules self._option_uri_strict = self._options.uri_check == RouterOptions.URI_CHECK_STRICT # supported features from "WAMP Advanced Profile" self._role_features = role.RoleDealerFeatures(caller_identification=True, pattern_based_registration=True, session_meta_api=True, registration_meta_api=True, shared_registration=True, progressive_call_results=True, registration_revocation=True, payload_transparency=True, testament_meta_api=True, payload_encryption_cryptobox=True, call_canceling=True) # store for call queues if self._router._store: self._call_store = self._router._store.call_store else: self._call_store = None
def __init__(self, handler): self._log = False self._handler = handler self._serializer = serializer.JsonSerializer() self._registrations = {} self._invocations = {} self._subscription_topics = {} self._my_session_id = util.id() self._handler.onOpen(self) roles = {u'broker': role.RoleBrokerFeatures(), u'dealer': role.RoleDealerFeatures()} msg = message.Welcome(self._my_session_id, roles) self._handler.onMessage(msg)
def __init__(self, handler): self._log = False self._handler = handler self._serializer = serializer.JsonSerializer() self._registrations = {} self._invocations = {} #: str -> ID self._subscription_topics = {} self._handler.onOpen(self) self._my_session_id = util.id() roles = {'broker': role.RoleBrokerFeatures(), 'dealer': role.RoleDealerFeatures()} msg = message.Welcome(self._my_session_id, roles) self._handler.onMessage(msg) self._fake_router_session = ApplicationSession() self._transport_details = TransportDetails()