當前位置: 首頁>>代碼示例>>Python>>正文


Python AMQPWriter.write_bit方法代碼示例

本文整理匯總了Python中serialization.AMQPWriter.write_bit方法的典型用法代碼示例。如果您正苦於以下問題:Python AMQPWriter.write_bit方法的具體用法?Python AMQPWriter.write_bit怎麽用?Python AMQPWriter.write_bit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在serialization.AMQPWriter的用法示例。


在下文中一共展示了AMQPWriter.write_bit方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _x_open

# 需要導入模塊: from serialization import AMQPWriter [as 別名]
# 或者: from serialization.AMQPWriter import write_bit [as 別名]
    def _x_open(self, virtual_host, capabilities="", insist=False):
        """
        open connection to virtual host

        This method opens a connection to a virtual host, which is a
        collection of resources, and acts to separate multiple
        application domains within a server.

        RULE:

            The client MUST open the context before doing any work on
            the connection.

        PARAMETERS:
            virtual_host: shortstr

                virtual host name

                The name of the virtual host to work with.

                RULE:

                    If the server supports multiple virtual hosts, it
                    MUST enforce a full separation of exchanges,
                    queues, and all associated entities per virtual
                    host. An application, connected to a specific
                    virtual host, MUST NOT be able to access resources
                    of another virtual host.

                RULE:

                    The server SHOULD verify that the client has
                    permission to access the specified virtual host.

                RULE:

                    The server MAY configure arbitrary limits per
                    virtual host, such as the number of each type of
                    entity that may be used, per connection and/or in
                    total.

            capabilities: shortstr

                required capabilities

                The client may specify a number of capability names,
                delimited by spaces.  The server can use this string
                to how to process the client's connection request.

            insist: boolean

                insist on connecting to server

                In a configuration with multiple load-sharing servers,
                the server may respond to a Connection.Open method
                with a Connection.Redirect. The insist option tells
                the server that the client is insisting on a
                connection to the specified server.

                RULE:

                    When the client uses the insist option, the server
                    SHOULD accept the client connection unless it is
                    technically unable to do so.

        """
        args = AMQPWriter()
        args.write_shortstr(virtual_host)
        args.write_shortstr(capabilities)
        args.write_bit(insist)
        self._send_method((10, 40), args)
        return self.wait(allowed_methods=[(10, 41), (10, 50)])  # Connection.open_ok  # Connection.redirect
開發者ID:vukasin,項目名稱:py-amqplib,代碼行數:74,代碼來源:connection.py


注:本文中的serialization.AMQPWriter.write_bit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。