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

Skip to content

Commit 316dd3d

Browse files
committed
Merge remote-tracking branch '0rpc/master' into bombela/master
2 parents fec4d82 + 3ba8bb5 commit 316dd3d

35 files changed

+87
-67
lines changed

AUTHORS

Lines changed: 0 additions & 6 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Open Source Initiative OSI - The MIT License (MIT):Licensing
22

33
The MIT License (MIT)
4-
Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
4+
Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy of
77
this software and associated documentation files (the "Software"), to deal in

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
zerorpc
22
=======
33

4-
.. image:: https://secure.travis-ci.org/dotcloud/zerorpc-python.png
5-
:target: http://travis-ci.org/dotcloud/zerorpc-python
4+
.. image:: https://secure.travis-ci.org/0rpc/zerorpc-python.png
5+
:target: http://travis-ci.org/0rpc/zerorpc-python
66

77
Mailing list: [email protected] (https://groups.google.com/d/forum/zerorpc)
88

bin/zerorpc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Open Source Initiative OSI - The MIT License (MIT):Licensing
44
#
55
# The MIT License (MIT)
6-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
6+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
77
#
88
# Permission is hereby granted, free of charge, to any person obtaining a copy of
99
# this software and associated documentation files (the "Software"), to deal in

doc/protocol.md

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,51 @@
1-
# ZeroRPC Protocol
1+
# zerorpc Protocol
22

33
THIS DOCUMENT IS INCOMPLETE, WORK IN PROGRESS!
44

5-
This document attempts to define the ZeroRPC protocol.
5+
This document attempts to define the zerorpc protocol.
66

77
## Introduction & History
88

9-
[ZeroRPC](http://zerorpc.dotcloud.com) is a modern communication layer for distributed systems built on top of [ZeroMQ](http://zeromq.org), developed at [dotCloud](http://dotcloud.com) since 2010 and open-sourced in 2012. It features a dead-simple API for exposing any object or module over the network, and a powerful gevent implementation which supports multiple ZMQ socket types, streaming, heartbeats and more. It also includes a simple command-line tool for interactive querying and introspection. The platform team at dotCloud uses it in production to transmit millions of messages per day across hundreds of services.
9+
zerorpc features a dead-simple API for exposing any object or module over the
10+
network, and a powerful gevent implementation which supports multiple ZMQ
11+
socket types, streaming, heartbeats and more. It also includes a simple
12+
command-line tool for interactive querying and introspection.
1013

11-
ZeroRPC uses ZMQ as a transport, but uses a communication protocol that is transport-agnostic. For a long time the reference documentation for that protocol was the python code itself. However since its recent surge in popularity many people have expressed interest in porting it to other programming languages. We hope that this standalone protocol documentation will help them.
12-
13-
A short warning: ZeroRPC started as a simple tool to solve a simple problem. It was progressively refined and improved to satisfy the growing needs of the dotCloud platform. The emphasis is on practicality, robustness and operational simplicity - sometimes at the expense of formal elegance and optimizations. We will gladly welcome patches focused on the latter so long as they don't hurt the former.
14+
zerorpc uses ZMQ as a transport, but uses a communication protocol that is
15+
transport-agnostic. For a long time the reference documentation for that
16+
protocol was the python code itself. However since its recent surge in
17+
popularity many people have expressed interest in porting it to other
18+
programming languages. We hope that this standalone protocol documentation will
19+
help them.
1420

1521
> The python implementation of zerorpc act as a reference for the whole
1622
> protocol. New features and experiments are implemented and tested in this
17-
> version first. This is also this implementation that is powering dotCloud's
18-
> infrastructure.
23+
> version first.
24+
25+
[zerorpc](http://www.zerorpc.io) is a modern communication layer for
26+
distributed systems built on top of [ZeroMQ](http://zeromq.org), initially
27+
developed at [dotCloud](http://www.dotcloud.com) starting in 2010 and
28+
open-sourced in 2012. when dotCloud pivoted to [Docker](http://www.docker.com),
29+
dotCloud was acquired by [cloudControl](https://www.cloudcontrol.com/), which
30+
then migrated over to theirs own PaaS before shutting it down.
31+
32+
In 2015, I (François-Xavier Bourlet) was given zerorpc by cloudControl, in an
33+
attempt to revive the project, maintain it, and hopefully drive its
34+
development.
35+
36+
### Warning
37+
38+
A short warning: zerorpc started as a simple tool to solve a simple problem. It
39+
was progressively refined and improved to satisfy the growing needs of the
40+
dotCloud platform. The emphasis is on practicality, robustness and operational
41+
simplicity - sometimes at the expense of formal elegance and optimizations. We
42+
will gladly welcome patches focused on the latter so long as they don't hurt
43+
the former.
44+
1945

2046
## Layers
2147

22-
Before diving into any details, let's divide ZeroRPC's protocol in three
48+
Before diving into any details, let's divide zerorpc's protocol in three
2349
different layers:
2450

2551
1. Wire (or transport) layer; a combination of ZMQ <http://www.zeromq.org/>
@@ -34,15 +60,15 @@ The wire layer is a combination of ZMQ and msgpack.
3460

3561
The basics:
3662

37-
- A ZeroRPC server can listen on as many ZMQ sockets as you like. Actually,
63+
- A zerorpc server can listen on as many ZMQ sockets as you like. Actually,
3864
a ZMQ socket can bind to multiple addresses. It can even *connect* to the
3965
clients (think about it as a worker connecting to a hub), but there are
40-
some limitations in that case (see below). ZeroRPC doesn't
66+
some limitations in that case (see below). zerorpc doesn't
4167
have to do anything specific for that: ZMQ handles it automatically.
42-
- A ZeroRPC client can connect to multiple ZeroRPC servers. However, it should
68+
- A zerorpc client can connect to multiple zerorpc servers. However, it should
4369
create a new ZMQ socket for each connection.
4470

45-
Since ZeroRPC implements heartbeat and streaming, it expects a kind of
71+
Since zerorpc implements heartbeat and streaming, it expects a kind of
4672
persistent, end-to-end, connection between the client and the server.
4773
It means that we cannot use the load-balancing features built into ZMQ.
4874
Otherwise, the various messages composing a single conversation could
@@ -52,12 +78,12 @@ That's why there are limitations when the server connects to the client:
5278
if there are multiple servers connecting to the same client, bad things
5379
will happen.
5480

55-
> Note that the current implementation of ZeroRPC for Python doesn't implement
81+
> Note that the current implementation of zerorpc for Python doesn't implement
5682
> its own load-balancing (yet), and still uses one ZMQ socket for connecting to
5783
> many servers. You can still use ZMQ load-balancing if you accept to disable
5884
> heartbeat and don't use streamed responses.
5985
60-
Every event from the event layer will be serialized with msgpack.
86+
Every event from the event layer will be serialized with msgpack.
6187

6288

6389
## Event layer
@@ -140,18 +166,18 @@ size of its local buffer. This is a hint for the remote, to tell it "send me
140166
more data!"
141167

142168
- Event's name: '\_zpc\_more'
143-
- Event's args: integer representing how many entries are available in the client's buffer.
169+
- Event's args: integer representing how many entries are available in the client's buffer.
144170

145171
FIXME WIP
146172

147173
## RPC Layer
148174

149-
In the first version of ZeroRPC, this was the main (and only) layer.
175+
In the first version of zerorpc, this was the main (and only) layer.
150176
Three kinds of events can occur at this layer: request (=function call),
151-
response (=function return), error (=exception).
177+
response (=function return), error (=exception).
152178

153179
Request:
154-
180+
155181
- Event's name: string with the name of the method to call.
156182
- Event's args: tuple of arguments for the method.
157183

@@ -160,14 +186,14 @@ support them. If you absolutely want to call functions with keyword
160186
arguments, you can use a wrapper; e.g. expose a function like
161187
"call_with_kwargs(function_name, args, kwargs)", where args is a list,
162188
and kwargs a dict. It might be an interesting idea to add such a
163-
helper function into ZeroRPC default methods (see below for definitions
189+
helper function into zerorpc default methods (see below for definitions
164190
of existing default methods).
165191

166192
Response:
167193

168194
- Event's name: string "OK"
169195
- Event's args: tuple containing the returned value
170-
196+
171197
> Note that if the return value is a tuple, it is itself wrapped inside a
172198
> tuple - again, for backward compatibility reasons.
173199
@@ -178,7 +204,7 @@ exception is raised), we use the ERR event.
178204

179205
- Event's name: string "ERR"
180206
- Event's args: tuple of 3 strings:
181-
- Name of the error (it should be the exception class name, or another
207+
- Name of the error (it should be the exception class name, or another
182208
meaningful keyword).
183209
- Human representation of the error (preferably in english).
184210
- If possible a pretty printed traceback of the call stack when the error occured.
@@ -190,7 +216,7 @@ exception is raised), we use the ERR event.
190216

191217
### Default calls
192218

193-
When exposing some code with ZeroRPC, a number of methods/functions are
219+
When exposing some code with zerorpc, a number of methods/functions are
194220
automatically added, to provide useful debugging and development tools.
195221

196222
- \_zerorpc\_ping() just answers with a pong message.
@@ -213,7 +239,7 @@ Messages part of a stream:
213239

214240
- Event's name: string "STREAM"
215241
- Event's args: tuple containing the streamed value
216-
242+
217243
When the STREAM reaches its end:
218244

219245
- Event's name: string "STREAM\_DONE"

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in
@@ -48,7 +48,7 @@
4848
version=__version__,
4949
description='zerorpc is a flexible RPC based on zeromq.',
5050
author=__author__,
51-
url='https://github.com/dotcloud/zerorpc-python',
51+
url='https://github.com/0rpc/zerorpc-python',
5252
packages=['zerorpc'],
5353
install_requires=requirements,
5454
tests_require=['nose'],

tests/test_buffered_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/test_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/test_client_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2013 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/test_client_heartbeat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/test_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/test_heartbeat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/test_middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/test_middleware_before_after_exec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/test_middleware_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/test_pubpush.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/test_reqstream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/test_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/test_zmq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/testutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

tests/zmqbug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

zerorpc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

zerorpc/channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

zerorpc/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Open Source Initiative OSI - The MIT License (MIT):Licensing
44
#
55
# The MIT License (MIT)
6-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
6+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
77
#
88
# Permission is hereby granted, free of charge, to any person obtaining a copy of
99
# this software and associated documentation files (the "Software"), to deal in

zerorpc/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Open Source Initiative OSI - The MIT License (MIT):Licensing
33
#
44
# The MIT License (MIT)
5-
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
5+
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
66
#
77
# Permission is hereby granted, free of charge, to any person obtaining a copy of
88
# this software and associated documentation files (the "Software"), to deal in

0 commit comments

Comments
 (0)