Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Flask_User_Reg
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Krish Moodbidri
Flask_User_Reg
Commits
38ea871c
Commit
38ea871c
authored
5 years ago
by
Mitchell Moore
Browse files
Options
Downloads
Patches
Plain Diff
add basic manager consumer/remove sys imports
parent
e096eef6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
message_manager.py
+27
-0
27 additions, 0 deletions
message_manager.py
ohpc_consumer.py
+0
-1
0 additions, 1 deletion
ohpc_consumer.py
ood_consumer.py
+0
-1
0 additions, 1 deletion
ood_consumer.py
with
27 additions
and
2 deletions
message_manager.py
+
27
−
0
View file @
38ea871c
#!/usr/bin/env python
import
pika
connection
=
pika
.
BlockingConnection
(
pika
.
ConnectionParameters
(
host
=
'
localhost
'
))
channel
=
connection
.
channel
()
channel
.
exchange_declare
(
exchange
=
'
direct_logs
'
,
exchange_type
=
'
direct
'
)
result
=
channel
.
queue_declare
(
queue
=
''
,
exclusive
=
True
)
queue_name
=
result
.
method
.
queue
channel
.
queue_bind
(
exchange
=
'
direct_logs
'
,
queue
=
queue_name
,
routing_key
=
"
manager
"
)
print
(
'
[*] Waiting for logs. To exit press CTRL+C
'
)
def
callback
(
ch
,
method
,
properties
,
body
):
print
(
"
[x] %r:%r
"
%
(
method
.
routing_key
,
body
))
# Todo: Make message manager more functional
channel
.
basic_consume
(
queue
=
queue_name
,
on_message_callback
=
callback
,
auto_ack
=
True
)
channel
.
start_consuming
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ohpc_consumer.py
+
0
−
1
View file @
38ea871c
#!/usr/bin/env python
import
pika
import
sys
connection
=
pika
.
BlockingConnection
(
pika
.
ConnectionParameters
(
host
=
'
localhost
'
))
...
...
This diff is collapsed.
Click to expand it.
ood_consumer.py
+
0
−
1
View file @
38ea871c
#!/usr/bin/env python
import
pika
import
sys
connection
=
pika
.
BlockingConnection
(
pika
.
ConnectionParameters
(
host
=
'
localhost
'
))
...
...
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