RejsonIPC¶
-
class
dasha.web.extensions.ipc_backends.rejson.RejsonIPC(label)[source]¶ Bases:
objectThis class manages a JSON object in redis.
The actual data stub stored in the redis db under
redis_keylooks like:{ '_ipc_obj': {'a': 'b'}, '_ipc_meta': { 'key': 'redis_key' 'rev': 0, 'created_at': [xxxx, yyyy], 'updated_at': [zzzz, wwww], } }
- Parameters
- labelstr
The label of this IPC channel.
Attributes Summary
A pipeline execution context.
The key of the redis db entry.
Methods Summary
ensure_obj(self[, obj])Setup the JSON data with
objif it does not exist yet.get(self[, path])Return value at
path.get_if_updated(self[, obj])Returns new obj if it is updated.
get_meta(self[, key])Return the metadata.
get_rejson_data(self)Return the entire JSON data.
init_ipc(url)is_initialized(self)is_null(self[, path])query_obj(self, op, path, \*args, \*\*kwargs)Query object at path
pathwithop.reset(self, obj)Reset the object with
obj.set(self, obj[, path])Set
objto path.type(self[, path])Attributes Documentation
-
connection¶
-
label¶
-
pipeline¶ A pipeline execution context.
-
redis_key¶ The key of the redis db entry.
Methods Documentation
-
ensure_obj(self, obj=None)[source]¶ Setup the JSON data with
objif it does not exist yet.- Returns
- bool
False if new object is created.
-
query_obj(self, op, path, \*args, \*\*kwargs)[source]¶ Query object at path
pathwithop.This assumes that the data exists.