Git Product home page Git Product logo

django-celery-rpc's People

Contributors

alfa24 avatar anatoliy-larin avatar bourivouh avatar dependabot[bot] avatar dtrst avatar kapellmeister avatar klem4 avatar krkmetal avatar pyup-bot avatar ttys15 avatar tumb1er avatar voron3x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

django-celery-rpc's Issues

Setup flavors

pip install django-celery-rpc[server]
pip install django-celery-rpc[client]

Server has extra dependency - Django itself. Setup.py should be configured to allow installation for both variants

Drop python-2.7, celery-3.1 and old Django

  1. Tox-based CI is now broken, because tox installs latest setuptools version, and it dropped support for use2to3 argument.
  2. use2to3 is used in anyjson package, last release was in 10 years ago
  3. anyjson is transient dependency for celery through kombu
  4. Celery-4.4 does not have this problems

So, to fix CI, we must either fix setuptools version for tox, or drop Celery-3.1 support.

atomic perform_changes

What do you think about making perform_changes atomic?
It's possible to add flag for enbale/disable atomicity in server settings or in task kwargs or both.

Exception: Q-object when x-json encoder enebled.

RequestError: ('Something goes wrong while sending request', EncodeError(RuntimeError("Django Q-objects does not supported by 'x-json' codec. For running with Q-objects use celery_rpc>0.16 on both sides and set 'x-rpc-json' as task serializer for client",),))

it seems impossible to do default value with empty Q object in filter sinature.

Unable to override CELERY_QUEUES

In create_celery_app it seems to be overriding CELERY_QUEUES with:

    app.conf.update(
        CELERY_HIGH_PRIORITY_QUEUE=high_q,
        CELERY_HIGH_PRIORITY_ROUTING_KEY=high_rk,
        CELERY_QUEUES=(Queue(q, routing_key=rk),
                       Queue(high_q, routing_key=high_rk)))

Wouldn't it be better if it could be overridden in CELERY_RPC_CONFIG? If so please let me know so I can submit a pull request

Support celery-4

  • Add to build matrix
  • Ensure everything works with recent python versions

select_related

I.e., we have City-Country-Continent db schema. I need to obtain continents for some cities. To do this, now I have these options:

  • query City with depth=2
  • write custom serializer class on server side

depth is not a bad option, but if you need more than one join, all these relations may become a problem.

So, the proposal is to add "select_related" option to filter() arguments.

  • it adds qs.select_related(*fields) to serializers queryset
  • it automatically created fields, named like select_related values

For example:

>>> client.filter('City', kwargs={
  'filters': {},
  'select_related': ['country__continent']
})

[{
  'id': 1,
  'name': 'Moscow',
  'country__continent': 'Eurasia'
}]

Problems found:

  • Django select_related() adds related objects as obj.country.continent
  • Thus, you need to write complex serializer method to obtain continent serialized data
  • if you setattr this method to GenericSerializerClass object, it doesn't become 'bound method', so some __new__ magic is needed
  • also, ModelSerializer need to be constructed for Continent model, and model class must be resolved before instantiation of GenericSerializerClass

Lot's of stuff to think about.

Call object method from pipe

Need something similar to:

p = cl.pipe()
p.filter('model', kwargs={'filters': {'active': True}})
p.method('deacivate', qs=True, args, kwargs)

if qs set then call queryset method, else on each model.

And:

p = cl.pipe()
p.create('model', data)
p.method('start_play', args, kwargs)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.