Beispiel #1
0
    def __init__(self, factory, serializers=None):
        """

        :param factory: A callable that produces instances that implement
            :class:`autobahn.wamp.interfaces.ITransportHandler`
        :type factory: callable
        :param serializers: A list of WAMP serializers to use (or None for default
           serializers). Serializers must implement
           :class:`autobahn.wamp.interfaces.ISerializer`.
        :type serializers: list
        """
        assert(callable(factory))
        self._factory = factory

        if serializers is None:
            serializers = get_serializes()

            if not serializers:
                raise Exception("could not import any WAMP serializers")

        self._serializers = {ser.RAWSOCKET_SERIALIZER_ID: ser for ser in serializers}
Beispiel #2
0
    def __init__(self, factory, serializer=None):
        """

        :param factory: A callable that produces instances that implement
            :class:`autobahn.wamp.interfaces.ITransportHandler`
        :type factory: callable
        :param serializer: The WAMP serializer to use (or None for default
           serializer). Serializers must implement
           :class:`autobahn.wamp.interfaces.ISerializer`.
        :type serializer: obj
        """
        assert (callable(factory))
        self._factory = factory

        if serializer is None:
            serializers = get_serializes()
            if serializers:
                serializer = serializers[0]

        if serializer is None:
            raise Exception("could not import any WAMP serializer")

        self._serializer = serializer
Beispiel #3
0
    def __init__(self, factory, serializer=None):
        """

        :param factory: A callable that produces instances that implement
            :class:`autobahn.wamp.interfaces.ITransportHandler`
        :type factory: callable
        :param serializer: The WAMP serializer to use (or None for default
           serializer). Serializers must implement
           :class:`autobahn.wamp.interfaces.ISerializer`.
        :type serializer: obj
        """
        assert(callable(factory))
        self._factory = factory

        if serializer is None:
            serializers = get_serializes()
            if serializers:
                serializer = serializers[0]

        if serializer is None:
            raise Exception("could not import any WAMP serializer")

        self._serializer = serializer
Beispiel #4
0
    def __init__(self, factory, serializers=None):
        """

        :param factory: A callable that produces instances that implement
            :class:`autobahn.wamp.interfaces.ITransportHandler`
        :type factory: callable
        :param serializers: A list of WAMP serializers to use (or None for default
           serializers). Serializers must implement
           :class:`autobahn.wamp.interfaces.ISerializer`.
        :type serializers: list
        """
        assert (callable(factory))
        self._factory = factory

        if serializers is None:
            serializers = get_serializes()

            if not serializers:
                raise Exception("could not import any WAMP serializers")

        self._serializers = {
            ser.RAWSOCKET_SERIALIZER_ID: ser
            for ser in serializers
        }
 def test_sers(self):
     serializers = get_serializes()
     self.assertTrue(len(serializers) > 0)
     m = serializers[0]().serialize(message.Abort(u'close'))
     print(m)
     self.assertTrue(m)