Skip to content

Commit 8553249

Browse files
author
DanielePalaia
committed
replace Disposition to OutcomeState
1 parent 42e7dbd commit 8553249

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

examples/getting_started/basic_example.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
AMQPMessagingHandler,
77
BindingSpecification,
88
Connection,
9-
Disposition,
109
Environment,
1110
Event,
1211
ExchangeSpecification,
1312
Message,
13+
OutcomeState,
1414
QuorumQueueSpecification,
1515
)
1616

@@ -126,11 +126,11 @@ def main() -> None:
126126
for i in range(MESSAGES_TO_PUBLISH):
127127
print("publishing")
128128
status = publisher.publish(Message(body="test"))
129-
if status.remote_state == Disposition.ACCEPTED:
129+
if status.remote_state == OutcomeState.ACCEPTED:
130130
print("message accepted")
131-
elif status.remote_state == Disposition.RELEASED:
131+
elif status.remote_state == OutcomeState.RELEASED:
132132
print("message not routed")
133-
elif status.remote_state == Disposition.REJECTED:
133+
elif status.remote_state == OutcomeState.REJECTED:
134134
print("message not rejected")
135135

136136
publisher.close()

rabbitmq_amqp_python_client/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040

4141
del metadata
4242

43+
OutcomeState = Disposition
44+
4345
__all__ = [
4446
"Connection",
4547
"Management",
@@ -62,10 +64,9 @@
6264
"ArgumentOutOfRangeException",
6365
"SslConfigurationContext",
6466
"ClientCert",
65-
"Delivery",
6667
"ConnectionClosed",
6768
"StreamOptions",
6869
"OffsetSpecification",
69-
"Disposition",
70+
"OutcomeState",
7071
"Environment",
7172
]

0 commit comments

Comments
 (0)