~ubuntu-branches/ubuntu/precise/pyzmq/precise

« back to all changes in this revision

Viewing changes to examples/mongodb/controller.py

  • Committer: Package Import Robot
  • Author(s): Debian Python Modules Team
  • Date: 2011-09-23 00:16:39 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: package-import@ubuntu.com-20110923001639-girjqodpb7uv17yu
Tags: 2.1.9-1
* New upstream version
  - should build on kFreeBSD without patches (Closes: #637777).
* Build-depend on zeromq 2.1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
    def start(self):
72
72
        context = zmq.Context()
73
 
        socket = context.socket(zmq.XREP)
 
73
        socket = context.socket(zmq.ROUTER)
74
74
        socket.bind(self._bind_addr)
75
75
        while True:
76
76
            msg = socket.recv_multipart()
84
84
            id = msg[0]
85
85
            operation = msg[1]
86
86
            contents = json.loads(msg[2])
87
 
            # always send back the id with XREP
 
87
            # always send back the id with ROUTER
88
88
            reply = [id]
89
89
            if operation == 'add':
90
90
                self.add_document(contents)