fastiot.db.redis_helper module¶
- class fastiot.db.redis_helper.RedisHelper(broker_connection)[source]¶
Saves files in the redis Database and sends the ID of the files as
fastiot.msg.redis.RedisMsg
.You can send files by using
send_data()
you must specify the data to send and the subject under which the data should be published. The max number of Datasets you can store at once is specified by :var: max_data_sets . If you add a Dataset above the given limit the first Dataset stored is deleted. When you have problems that an ID is overwritten before you accessed the data you can change the :var:`id_buffer` to have more Ids before an ID is reused.You can access the stored data with
get_data()
. The Id of the Data has to be provided. and the returned data will be deserialized withfastiot.core.serialization.serialize_from_bin()
.- max_data_sets¶
The max number of Datasets you can store at once
- id_buffer¶
:var:`max_data_sets` * :var:`id_buffer` is the total number of Ids, used before an id is overwritten