예제 #1
0
파일: server.py 프로젝트: audized/474a2
def notify_worker(id, sizes):
	jsonMessage = json.dumps(
					{
						'id': id,
						'sizes': sizes
					}
				)
	message = Message()
	message.set_body(jsonMessage)
	queue.write(message)
예제 #2
0
파일: api.py 프로젝트: Yunfeng01/SmartRoom
def notify_robot(userid, command,devicename,executedate):
    data = {
                'requestdate' : time.strftime("%Y-%m-%dT%H:%M:%S", time.gmtime()),
                'executedate' : executedate,
                'userid' : userid,
                'command' :command,
                'devicename' : devicename
           }
    m = RawMessage()
    m.set_body(json.dumps(data))
    status = queue.write(m)
    print 'your message sent : %s , status : %s, executedate:%s ' % ( m,status, executedate)
예제 #3
0
def notify_worker(id, sizes):
	data = {
                'submitdate' : time.strftime("%Y-%m-%dT%H:%M:%S", time.gmtime()),
                'id' : id,
                'sizes' :sizes
        }
     
        
        m = RawMessage()
        m.set_body(json.dumps(data))
        status = queue.write(m)
	print 'your message sent : %s , status : %s ' % ( m,status)
예제 #4
0
def notify_robot(userid, command, devicename, executedate):
    data = {
        'requestdate': time.strftime("%Y-%m-%dT%H:%M:%S", time.gmtime()),
        'executedate': executedate,
        'userid': userid,
        'command': command,
        'devicename': devicename
    }
    m = RawMessage()
    m.set_body(json.dumps(data))
    status = queue.write(m)
    print 'your message sent : %s , status : %s, executedate:%s ' % (
        m, status, executedate)
예제 #5
0
def notify_worker(id, sizes):
	# raise Exception('Implement me!')	
	sqsMessage = Message()

	jsonMessage = {
		"id" : id,
		"sizes" : sizes
	}

	sqsMessage.set_body(json.dumps(jsonMessage))

	status = queue.write(sqsMessage)

	return
예제 #6
0
def notify_worker(id, sizes):	
	m = Message()
	m.set_body(setupMessageJSON(id, sizes))
	#m.set_body("hello testing")
	queue.write(m)
예제 #7
0
def notify_worker(id, sizes):
	m = RawMessage()
	msg = json.dumps({"id": id, "sizes": sizes})
	print msg
	m.set_body(msg)
	queue.write(m)