Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ceb3ba2

Browse files
author
Solomon Hykes
committed
Renamed zerorpc-client to zerorpc
1 parent fa5a697 commit ceb3ba2

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

README.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ zerorpc
44
zerorpc is a flexible RPC implementation based on zeromq and messagepack.
55
Service APIs exposed with zerorpc are called "zeroservices".
66

7-
zerorpc comes with a convenient script, "zerorpc-client", allowing to:
7+
zerorpc comes with a convenient script, "zerorpc", allowing to:
88

99
* expose Python modules without modifying a single line of code,
1010
* call those modules remotely through the command line.
@@ -16,7 +16,7 @@ Create a server with a one-liner
1616
Let's see zerorpc in action with a simple example. In a first terminal,
1717
we will expose the Python "time" module::
1818

19-
$ zerorpc-client --server --bind tcp://0:1234 time
19+
$ zerorpc --server --bind tcp://0:1234 time
2020

2121
.. note::
2222
The bind address uses the zeromq address format. You are not limited
@@ -31,21 +31,21 @@ Call the server from the command-line
3131

3232
Now, in another terminal, call the exposed module::
3333

34-
$ zerorpc-client --client --connect tcp://0:1234 strftime %Y/%m/%d
34+
$ zerorpc --client --connect tcp://0:1234 strftime %Y/%m/%d
3535
Connecting to "tcp://0:1234"
3636
"2011/03/07"
3737

3838
Since the client usecase is the most common one, "--client" is the default
3939
parameter, and you can remove it safely::
4040

41-
$ zerorpc-client --connect tcp://0:1234 strftime %Y/%m/%d
41+
$ zerorpc --connect tcp://0:1234 strftime %Y/%m/%d
4242
Connecting to "tcp://0:1234"
4343
"2011/03/07"
4444

4545
Moreover, since the most common usecase is to *connect* (as opposed to *bind*)
4646
you can also omit "--connect"::
4747

48-
$ zerorpc-client tcp://0:1234 strftime %Y/%m/%d
48+
$ zerorpc tcp://0:1234 strftime %Y/%m/%d
4949
Connecting to "tcp://0:1234"
5050
"2011/03/07"
5151

@@ -56,7 +56,7 @@ See remote service documentation
5656
You can introspect the remote service; it happens automatically if you don't
5757
specify the name of the function you want to call::
5858

59-
$ zerorpc-client tcp://0:1234
59+
$ zerorpc tcp://0:1234
6060
Connecting to "tcp://0:1234"
6161
tzset tzset(zone)
6262
ctime ctime(seconds) -> string
@@ -78,7 +78,7 @@ Specifying non-string arguments
7878
Now, see what happens if we try to call a function expecting a non-string
7979
argument::
8080

81-
$ zerorpc-client tcp://0:1234 sleep 3
81+
$ zerorpc tcp://0:1234 sleep 3
8282
Connecting to "tcp://0:1234"
8383
Traceback (most recent call last):
8484
[...]
@@ -87,7 +87,7 @@ argument::
8787
That's because all command-line arguments are handled as strings. Don't worry,
8888
we can specify any kind of argument using JSON encoding::
8989

90-
$ zerorpc-client --json tcp://0:1234 sleep 3
90+
$ zerorpc --json tcp://0:1234 sleep 3
9191
Connecting to "tcp://0:1234"
9292
[wait for 3 seconds...]
9393
null
@@ -101,12 +101,12 @@ your server to act as a kind of worker, and connect to a hub or queue which
101101
will dispatch requests. You can achieve this by swapping "--bind" and
102102
"--connect"::
103103

104-
$ zerorpc-client --bind tcp://0:1234 localtime
104+
$ zerorpc --bind tcp://0:1234 localtime
105105

106106
We now have "something" wanting to call the "localtime" function, and waiting
107107
for a worker to connect to it. Let's start the worker::
108108

109-
$ zerorpc-client --server tcp://0:1234 time
109+
$ zerorpc --server tcp://0:1234 time
110110

111111
The worker will connect to the listening client and ask him "what should I
112112
do?"; the client will send the "localtime" function call; the worker will
@@ -120,10 +120,10 @@ Listening on multiple addresses
120120
What if you want to run the same server on multiple addresses? Just repeat
121121
the "--bind" option::
122122

123-
$ zerorpc-client --server --bind tcp://0:1234 --bind ipc:///tmp/time time
123+
$ zerorpc --server --bind tcp://0:1234 --bind ipc:///tmp/time time
124124

125-
You can then connect to it using either "zerorpc-client tcp://0:1234" or
126-
"zerorpc-client ipc:///tmp/time".
125+
You can then connect to it using either "zerorpc tcp://0:1234" or
126+
"zerorpc ipc:///tmp/time".
127127

128128
Wait, there is more! You can even mix "--bind" and "--connect". That means
129129
that your server will wait for requests on a given address, *and* connect
File renamed without changes.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
],
4646
zip_safe=False,
4747
scripts=[
48-
'bin/zerorpc-client'
48+
'bin/zerorpc'
4949
],
5050
license='MIT',
5151
classifiers=(

0 commit comments

Comments
 (0)