pipeless-ai / pipeless

An open-source computer vision framework to build and deploy apps in minutes
https://pipeless.ai
Apache License 2.0
689 stars 31 forks source link

feat(kv_store): Add KV store #78

Closed miguelaeh closed 8 months ago

miguelaeh commented 8 months ago

Description of the change

This PR adds a KV store that can be used to share data between frames.

The user can call pipeless_kvs_set and pipeless_kvs_get to set and get KV pairs.

The internal keys are automatically converted to the format stage_name:pipeline_id:user_key to avoid conflicts when running multiple streams and multiple stages per stream.

Finally, the pipeless_kvs_get function will return an empty value by default, including when the key does not exist. Since frames are executed in parallel, a key could not exist at the time of getting it, users need to take this into account. The pipeless_kvs_set function converts any value to string before inserting it into the store.

Benefits

Possible drawbacks

Applicable issues

Additional information