Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
b8a4d393
Commit
b8a4d393
authored
9 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
Task #8888: use optional other broker in RPC
parent
0efbb80f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LCS/Messaging/python/messaging/RPC.py
+7
-6
7 additions, 6 deletions
LCS/Messaging/python/messaging/RPC.py
with
7 additions
and
6 deletions
LCS/Messaging/python/messaging/RPC.py
+
7
−
6
View file @
b8a4d393
...
...
@@ -69,7 +69,7 @@ class RPC():
As a side-effect the sender and session are destroyed.
"""
def
__init__
(
self
,
service
,
**
kwargs
):
def
__init__
(
self
,
service
,
broker
=
None
,
**
kwargs
):
"""
Initialize an Remote procedure call using:
service= <str> Service Name
...
...
@@ -84,11 +84,12 @@ class RPC():
self
.
ForwardExceptions
=
kwargs
.
pop
(
"
ForwardExceptions
"
,
False
)
self
.
Verbose
=
kwargs
.
pop
(
"
Verbose
"
,
False
)
self
.
BusName
=
kwargs
.
pop
(
"
busname
"
,
None
)
self
.
ServiceName
=
service
self
.
ServiceName
=
service
self
.
broker
=
broker
if
self
.
BusName
is
None
:
self
.
Request
=
ToBus
(
self
.
ServiceName
)
self
.
Request
=
ToBus
(
self
.
ServiceName
,
broker
=
self
.
broker
)
else
:
self
.
Request
=
ToBus
(
"
%s/%s
"
%
(
self
.
BusName
,
self
.
ServiceName
))
self
.
Request
=
ToBus
(
"
%s/%s
"
%
(
self
.
BusName
,
self
.
ServiceName
)
,
broker
=
self
.
broker
)
if
len
(
kwargs
):
raise
AttributeError
(
"
Unexpected argument passed to RPC class: %s
"
%
(
kwargs
))
...
...
@@ -122,9 +123,9 @@ class RPC():
options
=
{
'
create
'
:
'
always
'
,
'
delete
'
:
'
receiver
'
}
ReplyAddress
=
"
reply.%s
"
%
(
str
(
uuid
.
uuid4
()))
if
self
.
BusName
is
None
:
Reply
=
FromBus
(
"
%s ; %s
"
%
(
ReplyAddress
,
str
(
options
)))
Reply
=
FromBus
(
"
%s ; %s
"
%
(
ReplyAddress
,
str
(
options
))
,
broker
=
self
.
broker
)
else
:
Reply
=
FromBus
(
"
%s/%s
"
%
(
self
.
BusName
,
ReplyAddress
))
Reply
=
FromBus
(
"
%s/%s
"
%
(
self
.
BusName
,
ReplyAddress
)
,
broker
=
self
.
broker
)
with
Reply
:
MyMsg
=
RequestMessage
(
content
=
Content
,
reply_to
=
ReplyAddress
,
has_args
=
HasArgs
,
has_kwargs
=
HasKwArgs
)
MyMsg
.
ttl
=
timeout
...
...
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