Skip to content

Commit 1577625

Browse files
committed
增加 nanomsg-python
1 parent 8d2fb83 commit 1577625

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

libs/python.wiki

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,27 @@ Home:[https://github.com/zeromq/pyzmq]
892892

893893
PyZMQ 2.2 之后的版本同时支持 ZMQ 的 3.x 和 4.x 版本。
894894

895+
<h4>nanomsg-python</h4>
896+
897+
Home:[https://github.com/tonysimpson/nanomsg-python]
898+
899+
这是 nanomsg 的 Python 封装库。同时支持 Python2 和 Python3。
900+
901+
代码示例——Hello world
902+
<source lang="python">
903+
from &#95;&#95;future&#95;&#95; import print_function
904+
from nanomsg import Socket, PAIR, PUB
905+
906+
s1 = Socket(PAIR)
907+
s2 = Socket(PAIR)
908+
s1.bind("inproc://test")
909+
s2.connect("inproc://test")
910+
s1.send(b"hello world")
911+
print(s2.recv())
912+
s1.close()
913+
s2.close()
914+
</source>
915+
895916
----
896917

897918
= 6 数据库 =

0 commit comments

Comments
 (0)