app.celery.MyCelery.subclass_with_self
- MyCelery.subclass_with_self(Class, name=None, attribute='app', reverse=None, keep_reduce=False, **kw)
Subclass an app-compatible class.
App-compatible means that the class has a class attribute that provides the default app it should use, for example:
class Foo: app = None
.- Parameters
Class (type) – The app-compatible class to subclass.
name (str) – Custom name for the target class.
attribute (str) – Name of the attribute holding the app, Default is ‘app’.
reverse (str) – Reverse path to this object used for pickling purposes. For example, to get
app.AsyncResult
, use"AsyncResult"
.keep_reduce (bool) – If enabled a custom
__reduce__
implementation won’t be provided.