Skip to content

Options

Options #

Source code in amqp_client_python/domain/models/options.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
class Options:
    def __init__(
        self,
        queue_name: str,
        rpc_queue_name: str,
        rpc_exchange_name: str,
        uri: str = None,
        login: str = "guest",
        passwd: str = "guest",
        domain: str = "localhost",
        port: int = None,
        vhost: str = "/",
        heartbeat: Optional[int] = 60,
        publisher_confirms=False,
        **kwargs: Dict[str, Any]
    ) -> None:
        """
        Create an Options object that hold the credentials and configs options.

        Args:
            queue_name: name of queue that will be used for subscriptions
            rpc_queue_name: name of queue that will be used for provide resources
            rpc_exchange_name: name of exchange that will be used for provide resources
            uri: uri for connection
            login: username
            passwd: password
            domain: domain
            port: port information
            vhost: vhost information
            heartbeat: interval between heartbeat
            publisher_confirms: wait for publisher confirmations
            **kwargs: pika options

        Returns:

        Raises:

        Examples:
            >>> Options("example", "example.rpc", "example.rpc", "amqp://admin:admin@localhost:5672/")

            >>> Options("example", "example.rpc", "example.rpc", "amqps://admin:admin@localhost:5671/")

            >>> Options("example", "example.rpc", "example.rpc", login="admin", passwd="admin", domain="localhost", port=5672)

            >>> Options("example", "example.rpc", "example.rpc", login="admin", passwd="admin", domain="localhost", port=5671)
        """
        self.queue_name = queue_name
        self.rpc_queue_name = rpc_queue_name
        self.rpc_exchange_name = rpc_exchange_name
        self.uri = uri
        self.login = login
        self.passwd = passwd
        self.domain = domain
        self.port = port
        self.vhost = vhost
        self.heartbeat = heartbeat
        self.publisher_confirms = publisher_confirms
        self.kwargs = kwargs

__init__(queue_name, rpc_queue_name, rpc_exchange_name, uri=None, login='guest', passwd='guest', domain='localhost', port=None, vhost='/', heartbeat=60, publisher_confirms=False, **kwargs) #

Create an Options object that hold the credentials and configs options.

Parameters:

Name Type Description Default
queue_name str

name of queue that will be used for subscriptions

required
rpc_queue_name str

name of queue that will be used for provide resources

required
rpc_exchange_name str

name of exchange that will be used for provide resources

required
uri str

uri for connection

None
login str

username

'guest'
passwd str

password

'guest'
domain str

domain

'localhost'
port int

port information

None
vhost str

vhost information

'/'
heartbeat Optional[int]

interval between heartbeat

60
publisher_confirms

wait for publisher confirmations

False
**kwargs Dict[str, Any]

pika options

{}

Examples:

>>> Options("example", "example.rpc", "example.rpc", "amqp://admin:admin@localhost:5672/")
>>> Options("example", "example.rpc", "example.rpc", "amqps://admin:admin@localhost:5671/")
>>> Options("example", "example.rpc", "example.rpc", login="admin", passwd="admin", domain="localhost", port=5672)
>>> Options("example", "example.rpc", "example.rpc", login="admin", passwd="admin", domain="localhost", port=5671)
Source code in amqp_client_python/domain/models/options.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
def __init__(
    self,
    queue_name: str,
    rpc_queue_name: str,
    rpc_exchange_name: str,
    uri: str = None,
    login: str = "guest",
    passwd: str = "guest",
    domain: str = "localhost",
    port: int = None,
    vhost: str = "/",
    heartbeat: Optional[int] = 60,
    publisher_confirms=False,
    **kwargs: Dict[str, Any]
) -> None:
    """
    Create an Options object that hold the credentials and configs options.

    Args:
        queue_name: name of queue that will be used for subscriptions
        rpc_queue_name: name of queue that will be used for provide resources
        rpc_exchange_name: name of exchange that will be used for provide resources
        uri: uri for connection
        login: username
        passwd: password
        domain: domain
        port: port information
        vhost: vhost information
        heartbeat: interval between heartbeat
        publisher_confirms: wait for publisher confirmations
        **kwargs: pika options

    Returns:

    Raises:

    Examples:
        >>> Options("example", "example.rpc", "example.rpc", "amqp://admin:admin@localhost:5672/")

        >>> Options("example", "example.rpc", "example.rpc", "amqps://admin:admin@localhost:5671/")

        >>> Options("example", "example.rpc", "example.rpc", login="admin", passwd="admin", domain="localhost", port=5672)

        >>> Options("example", "example.rpc", "example.rpc", login="admin", passwd="admin", domain="localhost", port=5671)
    """
    self.queue_name = queue_name
    self.rpc_queue_name = rpc_queue_name
    self.rpc_exchange_name = rpc_exchange_name
    self.uri = uri
    self.login = login
    self.passwd = passwd
    self.domain = domain
    self.port = port
    self.vhost = vhost
    self.heartbeat = heartbeat
    self.publisher_confirms = publisher_confirms
    self.kwargs = kwargs