Coder Social home page Coder Social logo

Comments (11)

hintjens avatar hintjens commented on June 2, 2024

Strange, I don't have an asyncsrv.pl example in the repository... did you write it?

from zguide.

pmarques avatar pmarques commented on June 2, 2024

Sorry, my fault. is not the perl that i'm talking about, but the python that is in the repo. (I have also changed the issue title)

from zguide.

felipecruz avatar felipecruz commented on June 2, 2024

I coded this example and it works.. can you tell what do not work? I'm sorry but cant understand your patch

from zguide.

felipecruz avatar felipecruz commented on June 2, 2024

My console output

Client worker-3 startedClient worker-0 started

Client worker-4 startedWorker started

Worker started
Worker started
Worker started
Worker started
Req #1 sent..
Req #1 sent..
Server received worker-0
Req #1 sent..
Worker received worker-0
Server received request #1
Worker received request #1
Server received worker-4
Worker received worker-4
Server received request #1
Worker received request #1
Server received worker-3
Worker received worker-3
Server received request #1
Worker received request #1
^CReq #2 sent..
Req #2 sent..
Req #2 sent..
Server received worker-0
Worker received worker-0
Server received request #2
Worker received request #2
Server received worker-4
Worker received worker-4
Server received request #2
Worker received request #2
Server received worker-3
Worker received worker-3
Server received request #2
Worker received request #2

from zguide.

pmarques avatar pmarques commented on June 2, 2024

Sorry, I should tell that on my first post...
The client shouldn't receive any response? AFAICS the client doesn't receive any response.
The patch is what change to able the messages to be send to the clients. Actually i don't understand why the first change is needed (the change of while "scope" by the device call) but it doesn't work before it.

from zguide.

felipecruz avatar felipecruz commented on June 2, 2024

i'll take a look.. what zmq version are you using?

from zguide.

pmarques avatar pmarques commented on June 2, 2024

the pyzmq is the last one from your repository and if 'm not wrong the ZMQv2.1.7 (I don't have access to the PC on i have done that)
EDIT:
The ZMQ version was confirmed, 2.1.7

from zguide.

hintjens avatar hintjens commented on June 2, 2024

Felipe, thanks for looking at Patrick's issue. If/when you have a new version of asyncsrv.py, give me a shout. :-)

from zguide.

felipecruz avatar felipecruz commented on June 2, 2024

Patrick.. sorry about so late reply

you found a bug :)

checkout this version..
https://github.com/felipecruz/zguide/blob/fc01da8e1e35f5d6e55b28f73e2b725ec061ac2f/examples/Python/asyncsrv.py

if runs ok i`ll do a pull request to the guide

Req #1 sent..
Server received worker-5

Server received request #1

Server received worker-0

Req #1 sent..
Server received request #1

Server received worker-9

Server received request #1

Worker received request #1 from worker-5
Sending to frontend request #1 id worker-5

Sending to frontend request #1 id worker-5

Client worker-5 received: request #1

Sending to frontend request #1 id worker-5

Sending to frontend request #1 id worker-5

Client worker-5 received: request #1

from zguide.

pmarques avatar pmarques commented on June 2, 2024

as far as i can see it is ok (i've also tested it). but.... I now understand why the while loop is not running before, (line 62) and in this version the problem persistes when the server frontend receive a message... you should use the same work flow there. This is the diff(erences):

65a66
>                     _id = frontend.recv()
67c68,69
<                     print 'Server received %s\n' % (msg)
---
>                     print 'Server received %s id %s\n' % (msg, _id)
>                     backend.send(_id, zmq.SNDMORE)

from zguide.

felipecruz avatar felipecruz commented on June 2, 2024

done.

pulling.

thanks man!

from zguide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.