Skip to content

Pyramid configuration with celery integration. Allows you to use pyramid .ini files to configure celery and have your pyramid configuration inside celery tasks.

xflash96/pyramid_celery

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Feature

  • Decorator based task
  • auto route and import
  • ONLY support mongodb

Getting Started

Include pyramid_celery either by setting your includes in your .ini, or by calling config.include('pyramid_celery').

    pyramid.includes = pyramid_celery
    mongodb.uri = mongodb://localhost:1234
    celery.dbname = celery

This will register all the functions decerotated with @task.

Then do scan to activate celery broker in myapp/init.py:

    config.scan()

Now you can either use class based:

from pyramid_celery import task

@task(name='add')
def add(self, x, y):
    print x+y

to define route of a task, do

from pyramid_celery import Task
class RemoteTask(Task):
	queue = 'remote'

@RemoteTask()
def mult(self, x, y):
    return x*y

Configuration

All standard celery configuration options will work. Check out http://ask.github.com/celery/configuration.html

Demo

Not supported currently

About

Pyramid configuration with celery integration. Allows you to use pyramid .ini files to configure celery and have your pyramid configuration inside celery tasks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%