by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 08 13:39
    odidev commented #1401
  • Jul 07 07:30
    minrk commented #1401
  • Jul 06 08:52
    minrk commented #1402
  • Jul 05 13:53
    grishatsuker edited #1402
  • Jul 05 13:36
    grishatsuker commented #1402
  • Jul 05 13:36
    grishatsuker commented #1402
  • Jul 05 13:32
    grishatsuker opened #1402
  • Jul 01 06:23
    odidev opened #1401
  • Jun 30 21:58
    Carreau commented #1400
  • Jun 30 21:58
    Carreau commented #1400
  • Jun 30 21:24
    Carreau commented #1400
  • Jun 30 21:20
    Carreau commented #1400
  • Jun 30 21:12
    Carreau commented #1400
  • Jun 30 18:30
    fperez opened #1400
  • Jun 28 03:03
    sakurai-youhei commented #1398
  • Jun 28 02:57
    sakurai-youhei commented #1398
  • Jun 27 16:36
    SotnikAP commented #1398
  • Jun 27 16:14
    SotnikAP commented #1398
  • Jun 26 21:26
    cjenkins5614 commented #1389
  • Jun 26 11:29
    dengf commented #1371
HAH! Sun
@omani
hi all
I want to implement a zmqstream with tornado ioloop per thread in my flask application
it seems that the ioloop always runs and uses the main thread (which is my flask app)
how can I have an ioloop within each thread?
I am spawning the threads with gevent.spawn()
Min RK
@minrk
This message was deleted
Jean Chassoul
@jchassoul
Hello!
just wondering if pyzmq can use the new resource property available on ZMTP 3.1
HAH! Sun
@omani
hi jean. there is still no resource implemented afaict
Jean Chassoul
@jchassoul
Yes I notice back then (= thanks for your message I'm using a great Erlang zmq implementation for that and of course pyzmq on this side of things and happy with the results <3 its going to be awesome when we also have resource implemented in Python!
I'm also really happy with the new socket types included on the last zeromq release can't wait for future me to play with them.
HAH! Sun
@omani
which socket type do you mean?
the radio/dish?
Jean Chassoul
@jchassoul
yes I for what I notice we have the final implementations of client/server abstractions to "replace" rep/router and req/dealer and the new radio/dish, etc patters
HAH! Sun
@omani
yes.
Jean Chassoul
@jchassoul
also the resource property available since ZMTP 3.1 is really, really, really powerful! I like that very much. (=
HAH! Sun
@omani
how do you know it is powerful if it is not implemented yet?
Jean Chassoul
@jchassoul
the @drozzy work on chumak the erlang implementation is incredible and clean, really beautiful code if you can said such of thing about code
Jean Chassoul
@jchassoul
that implementation support ZMTP 3.1 with the resource property available and excellent python + erlang examples.
HAH! Sun
@omani
can you provide a source/link pls?
Jean Chassoul
@jchassoul
HAH! Sun
@omani
I wonder why this hasn't implemented in pyzmq yet
Carlos Llamacho
@CMLL
hello pyzmq room
Jose Raffucci
@JoseRaffucci
Hello everyone, I have just started using zeromq/pyzmq with the draft socket types zmq_server and zmq_client. I noticed that when there is a message waiting for the zmq_server socket the event id returned is 3. It doesn't match any of the constants except for zmq_shared or zmq_queue, I just wanted to see if someone had some clarification for the event id returned.
Dev Aggarwal
@devxpy

Hello there!

I had some problems using the zmq PUB/SUB feature. Can someone please take a look that this question?

https://stackoverflow.com/questions/53287435/zmq-pub-sub-drops-messages-when-sleep-is-not-done-after-send

Thank you.

Søren Fuglede Jørgensen
@fuglede
I'm seeing a discrepancy between how zmq.PAIR is blocking on Windows and Linux; it's not clear to me what the expected behavior would be, but the discrepancy itself seems to suggest that something is off: https://stackoverflow.com/questions/55752288/receiving-zmq-messages-on-background-thread-fails-on-windows -- can anyone immediately see why this might be?
hyjiang7
@hyjiang7
Hi guys, I'm new to zmq. I have a client socket who is receiving data from the server socket. The client is totally unaware of what type of data is coming through. How can I check on the client side if the data is of json type or not?
Kevin Tewouda
@lewoudar
Hi guys, I'm a newbie to zmq. I'm trying to create a tiny scheduler in my Flask application but I encountered an error "address already used" I guess it's because my flask app runs on localhost, but I'm not sure.
This is a snippet of what I'm doing in the flask app
@app.route('/jobs', methods=['GET', 'POST'])
def jobs():
    if request.method == 'GET':
        data = job_schema.dump(Job.query.all(), many=True)
        return jsonify(data)
    if request.method == 'POST':
        data = request.get_json()
        job_id = scheduler.start_task(data['name'])
        return {'id': job_id}, 201
and this is a snippet of how I create the scheduler class is written
class Scheduler:

    def __init__(self, port: int = DEFAULT_WORKER_PORT):
        self._session = Session()
        self._context = zmq.Context()
        self._sender = self._context.socket(zmq.PUSH)
        self._sender.bind(f'tcp://*:{port}')
the flask listents on 127.0.0.1:5000
Kevin Tewouda
@lewoudar
the DEFAULT_WORKER_PORT is 5060
I'm running the app on Windows 10, using Flask 1.1.1 and pyzmq 18.1.0
Francisco Benavides
@fbenavides69
Hello everyone, I have been looking into integrating ZeroMQ to a library I have in Python 3.8.1 in Ubuntu 18.04, have not been able to get it up and running, any suggestions?
I use PyEnv and PipEnv as well
Trying the Zmq Queue device for inter-process communication
Francisco Benavides
@fbenavides69
-Update: seems that having a old version of Ubuntu is not quite the best thing for zMQ so I am assessing the possibility of migrating to Ubuntu 19.10 and then eventually to 20.04 which will be LTS
Maxim Ivanov
@ulidtko

Hi all!
I'm going through the zguide, checking out examples... Noticed something weird, need help explaining it.

This example: https://github.com/booksbyus/zguide/tree/master/examples/Python wuserver.py, wuclient.py. Server generates uniform-randomly "zip codes" as randrange(1, 10000). Client subscribes, consumes 5 updates for a specific zip-code, prints average and exists.

I'm running the server, unmodified, in one terminal. And running the client, also unmodifed, with arguments of differing lengths. I'm surprised by the timings of client, they seem to depend on the "zipcode" length:

time python wuclient.py 9  --> ~70ms
time python wuclient.py 9999  --> ~600ms

How is that? Intuitively, I'd expect the uuhh expected wait time to be independent from the pubsub key. But it seems it's not. What's going on here?

Maxim Ivanov
@ulidtko
... Okay, got it. zmq.SUBSCRIBE filter sets server-side prefix match. So the shorter the prefix -- the easier it's to fish out a string with matching prefix of a stream of random garbage.
Brandon Dube
@brandondube
I have a server that uses zmq.REP for its socket type, and client with zmq.REQ. When I send a message over the socket and read the response, a 'blank' frame is recieved on the server. I.e. on the client, sock.send_string('frame?'); buf = sock.recv(0, True, False);. The server gets frame? then '' on the input - why?
is this expected and I just misunderstand?
oh, I should read my own log more carefully. operation cannot be completed in current state with the zero value string as the message. I assume this is because I have a loop reading the connection in one thread, and another sending out replies in another?
avijayakumar-navsim
@avijayakumar-navsim
Hi. Is it possible to communicate between C#(client) and Python(server) using pyzmq and NetMQ in C# ?
Kevin Tewouda
@lewoudar

Hi. Is it possible to communicate between C#(client) and Python(server) using pyzmq and NetMQ in C# ?

I don't see why that wouldn't be possible, as long as you're using compatible sockets, the programming language is just a tool to enable communication.

Bas Nijholt
@basnijholt
I am trying to parallelize the send of a REP-REQ protocol. I have found that I can use a ROUTER DEALER to have parallel REP sockets, like in http://zguide.zeromq.org/py:mtserver
I would like to use asyncio instead of threads but I am not sure how. Is that even possible there?
Bas Nijholt
@basnijholt

I believe it is something like

import asyncio
import time
import zmq
import zmq.asyncio

ctx = zmq.asyncio.Context()

def _dispatch(request):
    return time.time()

async def worker_routine(url_worker):
    """Worker routine"""
    sock = ctx.socket(zmq.REP)
    sock.connect(url_worker)
    try:
        while True:
            request = await sock.recv_pyobj()
            reply = _dispatch(request)
            await sock.send_pyobj(reply)
    finally:
        sock.close()

if __name__ == "__main__":
    url_worker = "inproc://workers"
    url_client = "tcp://*:5555"
    clients = ctx.socket(zmq.ROUTER)
    clients.bind(url_client)
    workers = ctx.socket(zmq.DEALER)
    workers.bind(url_worker)

    coro = asyncio.gather(*(worker_routine(url_worker) for i in range(10)))

    zmq.proxy(clients, workers)  # <------ this is blocking
    ioloop = asyncio.get_event_loop()
    task = ioloop.run_until_complete(coro)

but not quite because zmq.proxy is blocking.

Bas Nijholt
@basnijholt
I found what I needed and created this Gist: https://gist.github.com/basnijholt/5de348b6d77d633a63a15c3735da9480
Min RK
@minrk
@basnijholt can I ask why you want to avoid threads? zmq.proxy in a thread ought to behave better most of the time, since it never acquires the GIL (it's a C function using only the underlying libzmq sockets).