-
Notifications
You must be signed in to change notification settings - Fork 19
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
remove file from memory after expire #1
Labels
Comments
@kostya Is there any native tool for that? My naive idea is to do it manually like: def read
return @string if @string
@string = ....
if @expire_in
spawn do
sleep @expire_id
@string = nil
end
end
@string
end |
i am using i think you should create one loop for class, like this: every(10.seconds) do
@files.each do |file|
file.expire! if file.expired?
end
end |
hm, btw you can you also https://github.com/kostya/memory_cache, this is actually memory cache with expires, but this is not supported access time right now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for each file add access time, and allow to expire rare-access keys. this is should save process memory.
like this:
BakedFileSystem.load("dir", expire_in: 1.hour)
The text was updated successfully, but these errors were encountered: