Skip to content
/ pampas Public

pampas: distribute tasks across machines using message brokers over stomp

Notifications You must be signed in to change notification settings

averni/pampas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pampas:

Idee:


Design:

Utilizzo:
- Testing in locale:
    import os, errno
    def mkdir_p(path):
        try:
            os.makedirs(path)
        except OSError as exc: # Python >2.5
            if exc.errno == errno.EEXIST:
                pass
            else: raise

    messagequeue = '/queue/social'
    basepath = '/home/antonio/code/trunk/commons/python/pampas/test/filemq'
    mkdir_p(basepath)
    mf = TestFactory(basepath)
    mf.setMessageQueue(messagequeue)

- Producer:
    prod = mf.createProducer()
    prod.sendMessage({"testo":"foo"})

- Consumer:
    def f(h,m):
        logger.info("FunzioneF::Messaggio: %s - %s" % (str(h),str(m))
    consumer = mf.createConsumer(f)
    with consumer:
        consumer.run()

Esempi:


About

pampas: distribute tasks across machines using message brokers over stomp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published