reduxdj
unread,Jan 24, 2011, 11:20:17 PM1/24/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to AmFast
1. I have a process that creates the Tornado IOLoop - I can call
messages with the test application and receive the callback
2. How do I send messages to channel with AsyncMessage
I am running this script called receive.py with pika, and AMQP,
however I can't write the messages to Flash, thanks:
#!/usr/bin/env python
import pika
from amfast.remoting import flex_messages
import logging
import optparse
import os
import sys
import pika
import tornado.httpserver
import tornado.ioloop
import amfast
from amfast.remoting.tornado_channel import ChannelSet,
TornadoChannelSet, TornadoChannel
connection = pika.AsyncoreConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')
print ' [*] Waiting for messages. To exit press CTRL+C'
def callback(ch, method, properties, body):
msg = flex_messages.AsyncMessage(headers=None,body="Hello World",
destination="messages",clientId=1)
channel_set = TornadoChannelSet(notify_connections=True)
channel_set.publishMessage(msg)
#channel_set.publishObject("Hello World", "topic-
name",sub_topic="sub-topic-name", headers=None, ttl=30000)
print " [x] Received %r" % (body,)
channel.basic_consume(callback,
queue='hello',
no_ack=True)
pika.asyncore_loop()