how to return two pipes from a function registered to a multiprocessing.manager?
I have played around with this for a while and feel like I', constantly hitting my head against a wall i have 3 different bits of code the first two work and following logic the second one should as well.

This manager:

    from multiprocessing.managers import BaseManager
    def getAB(): return 'spam', 'eggs'
    class MyManager(BaseManager): pass
    MyManager.register('getAB', callable=getAB)
    m = MyManager(address=('', 50000), authkey='A')
    s = m.get_server()
    s.serve_forever()
and this client:

    from multiprocessing.managers import BaseManager
    class MyManager(BaseManager): pass
    MyManager.register('getAB')
    manager = QueueManager(address=('127.0.0.1', 50000), authkey='A')
    manager.connect()
    a,b = manager.getAB()._getvalue()
    print "a", a
    print "b", b
work fine together and output

    a spam
    b eggs
by changing the getAB to this getPipe, and threading serve_forever you get these changes

    pipeServer, pipeClient = Pipe()
    def getPipe(): return pipeClient

    t = Thread(target=s.serve_forever)
    t.daemon = True
    t.start()

    print "pipe", pipeServer.recv()
and changing the end of the client to this

    pipe = manager.getPipe()
    pipe.send("spam")
gives

    pipe spam
now putting both these together it would seem logical to assume you could have a function getPipes that returns two pipes this is my attempt:

    pipe1Server, pipe1Client = Pipe()
    pipe2Server, pipe2Client = Pipe()
    def getPipes():
        return pipe1Client, pipe2Client

    class MyManager(BaseManager): pass
    MyManager.register('getPipes', callable=getPipes)
    m = MyManager(address=('', 50000), authkey='A')
    s = m.get_server()
    t = Thread(target=s.serve_forever)
    t.daemon = True
    t.start()

    print "1", pipe1Server.recv()
    print "2", pipe2Server.recv() 
and using this client you should be able to get the pipes and send to them

    from multiprocessing.managers import BaseManager
    class MyManager(BaseManager): pass
    MyManager.register('getPipes')
    manager = MyManager(address=('127.0.0.1', 50000), authkey='A')
    manager.connect()
    data = manager.getPipes()
    pipe1, pipe2 = data._getvalue()
    pipe1.send("spam")
    pipe2.send("eggs")

However i get this error: (in the client process)

    Traceback (most recent call last):
      File "f.py", line 7, in <module>
        pipe1, pipe2 = data._getvalue()
      File "/usr/lib/python2.7/multiprocessing/managers.py", line 779, in _getvalue
        return self._callmethod('#GETVALUE')
      File "/usr/lib/python2.7/multiprocessing/managers.py", line 759, in _callmethod
        kind, result = conn.recv()
    TypeError: Required argument 'handle' (pos 1) not found

now i think this has something to do with the way the Connection objects are pickled but i have no idea how to get around this?
how to return two pipes from a function registered to a multiprocessing.manager?
===

I have played around with this for a while and feel like I', constantly hitting my head against a wall i have 3 different bits of code the first two work and following logic the second one should as well.

This manager:

    from multiprocessing.managers import BaseManager
    def getAB(): return 'spam', 'eggs'
    class MyManager(BaseManager): pass
    MyManager.register('getAB', callable=getAB)
    m = MyManager(address=('', 50000), authkey='A')
    s = m.get_server()
    s.serve_forever()
and this client:

    from multiprocessing.managers import BaseManager
    class MyManager(BaseManager): pass
    MyManager.register('getAB')
    manager = QueueManager(address=('127.0.0.1', 50000), authkey='A')
    manager.connect()
    a,b = manager.getAB()._getvalue()
    print "a", a
    print "b", b
work fine together and output

    a spam
    b eggs
by changing the getAB to this getPipe, and threading serve_forever you get these changes

    pipeServer, pipeClient = Pipe()
    def getPipe(): return pipeClient

    t = Thread(target=s.serve_forever)
    t.daemon = True
    t.start()

    print "pipe", pipeServer.recv()
and changing the end of the client to this

    pipe = manager.getPipe()
    pipe.send("spam")
gives

    pipe spam
now putting both these together it would seem logical to assume you could have a function getPipes that returns two pipes this is my attempt:

    pipe1Server, pipe1Client = Pipe()
    pipe2Server, pipe2Client = Pipe()
    def getPipes():
        return pipe1Client, pipe2Client

    class MyManager(BaseManager): pass
    MyManager.register('getPipes', callable=getPipes)
    m = MyManager(address=('', 50000), authkey='A')
    s = m.get_server()
    t = Thread(target=s.serve_forever)
    t.daemon = True
    t.start()

    print "1", pipe1Server.recv()
    print "2", pipe2Server.recv() 
and using this client you should be able to get the pipes and send to them

    from multiprocessing.managers import BaseManager
    class MyManager(BaseManager): pass
    MyManager.register('getPipes')
    manager = MyManager(address=('127.0.0.1', 50000), authkey='A')
    manager.connect()
    data = manager.getPipes()
    pipe1, pipe2 = data._getvalue()
    pipe1.send("spam")
    pipe2.send("eggs")

However i get this error: (in the client process)

    Traceback (most recent call last):
      File "f.py", line 7, in <module>
        pipe1, pipe2 = data._getvalue()
      File "/usr/lib/python2.7/multiprocessing/managers.py", line 779, in _getvalue
        return self._callmethod('#GETVALUE')
      File "/usr/lib/python2.7/multiprocessing/managers.py", line 759, in _callmethod
        kind, result = conn.recv()
    TypeError: Required argument 'handle' (pos 1) not found

now i think this has something to do with the way the Connection objects are pickled but i have no idea how to get around this?