https://github.com/zhum/exedb
Database-like interface to executables with caching, without external databases, queues, etc.
https://github.com/zhum/exedb
Last synced: over 1 year ago
JSON representation
Database-like interface to executables with caching, without external databases, queues, etc.
- Host: GitHub
- URL: https://github.com/zhum/exedb
- Owner: zhum
- License: mit
- Created: 2014-01-27T18:36:47.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-02-09T14:11:28.000Z (over 12 years ago)
- Last Synced: 2025-01-30T20:15:03.950Z (over 1 year ago)
- Language: Ruby
- Size: 188 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Exedb
-----
This is simple Ruby class, which implements
database-like interface for executables.
For example:
```ruby
e=Exedb.new("my_long_working_exe arg1 arg2")
e.cache_timeout=10 # 10 seconds timeout
e.get # run and return exe output
e.get # just return exe output again!
sleep 10
e.get # run exe again (cache is timed out)
e.update # run exe and update cache NOW!
```
If another program is running another instance on the
same Exedb it will wait for first one finish.
Methods and constants
---------------------
- ::new(str=nil) - create new instance, str=exec line
- ::DEF_DIR - default dir for cache files
- ::DEF_CACHE_TIMEOUT - default cache timeout
- \#get - get exe output
- \#update - run exe anyway, return output
Accessors
--------
- cache_timeout
- cache_dir