Search code examples
pythongoogle-app-enginechannel-api

Using GAE Channel's from a TaskQueue


I have been trying for some days to use the channel.send_message API in GAE (via Python) to send a message to a client when a TaskQueue process has finished. It just WON'T work.

I can use send_message from another request and it works fine and is received. But nothing when send_message is called from a TaskQueue.
I've tried this both locally and deployed to GAE full. Is this not a supported scenario?


Solution

  • It works fine for me. Make sure you are publishing using the same client key keyid in both

    channel.send_message(keyid,message_string)
    

    and

    token = channel.create_channel(keyid)
    

    i.e. make sure you are NOT using token as the first parameter in send_message().

    I would log (using logging.info()) the keyid (and token) everywhere you use it in the python code and console.log() the token in the javascript code to make sure they all match where they should.