Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[discussion] Persistent storage improvments (TTL, auto-flush etc.) #4

Closed
byaka opened this issue Mar 27, 2018 · 7 comments
Closed

[discussion] Persistent storage improvments (TTL, auto-flush etc.) #4

byaka opened this issue Mar 27, 2018 · 7 comments
Assignees

Comments

@byaka
Copy link

byaka commented Mar 27, 2018

No description provided.

@willforde willforde self-assigned this Mar 30, 2018
@willforde
Copy link
Owner

I have changed the storage objects to add support for TTL.
See ffea630

@byaka
Copy link
Author

byaka commented Mar 31, 2018

ty
if i not missed something, ttl expiration checking only on init. So if ttl lower than script's executing time - script will have expired data until restart. I think its not big problem, just need to be explained in doc.

@byaka
Copy link
Author

byaka commented Mar 31, 2018

also one stupid question - why flushing only manual? Just in my opinion 'by-default' persistent storage must have auto-save mode if script ended without exceptions. Your cool framework have alot things, that simplifing addon-developing but this one is... strange

willforde added a commit that referenced this issue Apr 1, 2018
@willforde
Copy link
Owner

willforde commented Apr 1, 2018

I attempted to change when I do the expiration check, but I noticed that there was too high of a chance of a race condition. Data could expire in between checking existence of data and processing it.

I see you're point on the flushing. I have set it to flush whenever the object is closed.
Thanks. I'm always looking for ways to simplify things.

@byaka
Copy link
Author

byaka commented Apr 1, 2018

Thanks for mantaining this project!

I dont know enouth about Kodi's plugin architecture, so maybe thing that i'll say now just stupid. How about creating separated process, that allow comunicating by socket (*UDS where possible, where not - local TCP) and implements simple locking mechanism on it. So when some script want to CHANGE, CHECK, LOAD or DUMP persistent storage, it send LOCK and after all done, UNLOCK. Becouse this separated process dont do anything heavy, only store LOCKING status per storage - i'm sure it bring minimal overhead (especially over *UDS where possible). And you will have simple and dereminated locking mechanism on all platforms without potential problems with IPC.
What u thinking about this way?

@byaka byaka changed the title TTL for storage instances missed [discussion] Persistent storage improvments (TTL, auto-flush etc.) Apr 1, 2018
@willforde
Copy link
Owner

willforde commented Apr 2, 2018

Something like that already exists for Kodi. https://kodi.wiki/view/Add-on:Common_plugin_cache
I looked into using it before, but there was a noticeable delay when importing the module, more than I was comfortable with.

@byaka
Copy link
Author

byaka commented Apr 2, 2018

hmm intersting, missed this lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants