Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
1f2b284f
Commit
1f2b284f
authored
Mar 14, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added properties
parent
776ca552
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
drip-planner.tar.gz
drip-planner.tar.gz
+0
-0
rpc_server.py
drip-planner/rpc_server.py
+12
-1
No files found.
drip-planner.tar.gz
View file @
1f2b284f
No preview for this file type
drip-planner/rpc_server.py
View file @
1f2b284f
...
@@ -15,9 +15,14 @@ import random
...
@@ -15,9 +15,14 @@ import random
import
time
import
time
import
json
import
json
print
"---------"
if
len
(
sys
.
argv
)
>
1
:
rabbitmq_host
=
sys
.
argv
[
1
]
else
:
rabbitmq_host
=
'127.0.0.1'
connection
=
pika
.
BlockingConnection
(
pika
.
ConnectionParameters
(
host
=
'127.0.0.1'
))
connection
=
pika
.
BlockingConnection
(
pika
.
ConnectionParameters
(
host
=
rabbitmq_host
))
channel
=
connection
.
channel
()
channel
=
connection
.
channel
()
channel
.
queue_declare
(
queue
=
'planner_queue'
)
channel
.
queue_declare
(
queue
=
'planner_queue'
)
...
@@ -154,12 +159,18 @@ def on_request(ch, method, props, body):
...
@@ -154,12 +159,18 @@ def on_request(ch, method, props, body):
body
=
str
(
response
))
body
=
str
(
response
))
ch
.
basic_ack
(
delivery_tag
=
method
.
delivery_tag
)
ch
.
basic_ack
(
delivery_tag
=
method
.
delivery_tag
)
channel
.
basic_qos
(
prefetch_count
=
1
)
channel
.
basic_qos
(
prefetch_count
=
1
)
channel
.
basic_consume
(
on_request
,
queue
=
'planner_queue'
)
channel
.
basic_consume
(
on_request
,
queue
=
'planner_queue'
)
print
(
" [x] Awaiting RPC requests"
)
print
(
" [x] Awaiting RPC requests"
)
channel
.
start_consuming
()
channel
.
start_consuming
()
#f = open("../doc/json_samples/plannerInput2.json","r")
#f = open("../doc/json_samples/plannerInput2.json","r")
#body=f.read()
#body=f.read()
#response = handleDelivery(body)
#response = handleDelivery(body)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment