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

Expiration time for workers #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aleksei4er
Copy link

If cache ttl times out while php worker executing, it would be great to update feature flag value.

Copy link
Collaborator

@mKnoop mKnoop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Idea. But i think we should also consider the cache hash keys for the expiration time and not set the value for all entries once

@b3nl
Copy link
Contributor

b3nl commented Aug 10, 2022

Nice Idea. But i think we should also consider the cache hash keys for the expiration time and not set the value for all entries once

@mKnoop What is your reasoning behind this?

@mKnoop
Copy link
Collaborator

mKnoop commented Aug 10, 2022

Nice Idea. But i think we should also consider the cache hash keys for the expiration time and not set the value for all entries once

@mKnoop What is your reasoning behind this?

The implementation in this pr will set a global expiration time if a new cache entry will be written. If later in the process we want to refetch a existing item from the cache the expiration time from the last new entry will be used instead of the expiration time of the specific entry. So in my opinion the expiration time should be item specific and the optimal workflow should be:

Existing entry:

  1. Try to fetch from the memory cache
  2. If item has been found check if the time for this specific entry has been expired
  3. If item is not expired, return the item

new entry:

  1. Try to fetch from the memory cache
  2. If no item has been found try to fetch from cache pool and return found item
  3. If the item can also not be found in the pool fetch entry from the activator and write entry to the memory cache and cache pool
  4. Set the expiration time for this specific item

I think this should cover the initial proposal that in long running processes the memory cache value will also be refreshed after the expiration time

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

Successfully merging this pull request may close these issues.

None yet

3 participants