get_simple_message

Description

Retrieves the first message for the specified (destination) experiment from the message queue.

Experiments may send messages to each other. A message is an object which may have any format (that MongoDB will accept). Messages have associated with them a source experiment id, and a destination experiment id. When messages are submitted they are appended to a message queue for each destination experiment.

If there are no messages for the specified experiment in the message queue (what happens then?)

Arguments:

'experiment_id' -- destination experiment id

Simple Example

eid = str(uuid.uuid1())
msg = "test"+str(uuid.uuid1())
resp = pq.send_simple_message({'experiment_id':eid,'message':msg},remote=True)
dat = pq.get_simple_message({'experiment_id':eid},remote=True)

Simple Example Output

Failure Examples

resp = pq.get_simple_message({'experiment_id':None},remote=True)

Failure Examples Output

Three Examples

eid = str(uuid.uuid1())
resp = pq.get_simple_message({'experiment_id':eid},remote=True)

####################################

eid = str(uuid.uuid1())
resp = pq.send_simple_message({'experiment_id':eid,'message':msg},remote=True)
dat = pq.get_simple_message({'experiment_id':eid,'spurious':'asdfasdf'},remote=True)

####################################

resp = pq.get_simple_message({},remote=True)

Three Examples Output