Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
coolamqp
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
coolamqp
Commits
f0e4dbb2
Commit
f0e4dbb2
authored
6 months ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
draft: fixes
#4
parent
51fd0343
No related branches found
No related tags found
No related merge requests found
Pipeline
#63438
failed with stages
Stage: unittest
Stage: build
in 1 minute and 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
coolamqp/attaches/declarer.py
+1
-16
1 addition, 16 deletions
coolamqp/attaches/declarer.py
with
1 addition
and
16 deletions
coolamqp/attaches/declarer.py
+
1
−
16
View file @
f0e4dbb2
...
...
@@ -192,9 +192,6 @@ class Declarer(Channeler, Synchronized):
Channeler
.
__init__
(
self
)
Synchronized
.
__init__
(
self
)
self
.
cluster
=
cluster
self
.
declared
=
set
()
# since Queues and Exchanges are hashable...
# anonymous queues aren't, but we reject those
# persistent
self
.
left_to_declare
=
collections
.
deque
()
# since last disconnect. persistent+transient
# deque of Operation objects
...
...
@@ -219,10 +216,6 @@ class Declarer(Channeler, Synchronized):
while
len
(
self
.
left_to_declare
)
>
0
:
self
.
left_to_declare
.
pop
().
on_connection_dead
()
# recast current declarations as new operations
for
dec
in
self
.
declared
:
self
.
left_to_declare
.
append
(
Operation
(
self
,
dec
))
super
(
Declarer
,
self
).
on_close
()
return
...
...
@@ -267,7 +260,7 @@ class Declarer(Channeler, Synchronized):
return
fut
def
declare
(
self
,
obj
,
persistent
=
False
,
span
=
None
):
def
declare
(
self
,
obj
,
span
=
None
):
"""
Schedule to have an object declared.
...
...
@@ -280,11 +273,7 @@ class Declarer(Channeler, Synchronized):
Queue declarations CAN fail.
Note that if re-declaring these fails, they will be silently discarded.
You can subscribe an on_discard(Exchange | Queue) here.
:param obj: Exchange or Queue instance
:param persistent: will be redeclared upon disconnect. To remove, use
"
undeclare
"
:param span: span if opentracing is installed
:return: a Future instance
:raise ValueError: tried to declare anonymous queue
...
...
@@ -298,10 +287,6 @@ class Declarer(Channeler, Synchronized):
fut
=
Future
()
fut
.
set_running_or_notify_cancel
()
if
persistent
:
if
obj
not
in
self
.
declared
:
self
.
declared
.
add
(
obj
)
self
.
left_to_declare
.
append
(
Operation
(
self
,
obj
,
fut
,
span
,
enqueued_span
))
self
.
_do_operations
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment