0.0
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Preforking daemon that makes all ruby binaries faster
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Preforking to make all ruby binaries faster.

Worker:

  • starts when needed
  • kept alive per directory and executable
  • prefers bundled executables
  • stops when not used for 1 hour
  • receives environment / stdin / stdout / stderr

Usage

# install gem and shell executable
gem install ruby-cli-daemon
ruby -rruby_cli_daemon -e "RubyCliDaemon.install '/usr/local/bin/ruby-cli-daemon'"

alias rubocop="ruby-cli-daemon rubocop" # add to ~/.bash_profile
rubocop -v # cold start 1.20s
rubocop -v # warm start 0.19s # NOTE: still ~120ms easy fat to trim for future versions

Gotchas

  • rake release to release a gem does not work, since gemspec is not be reloaded
  • worker does not restart when: Gemfile/Gem/monkey-patches change
  • env vars that are used on startup cannot be changed
  • INT signal is translated to TERM

Development

  • Run locally with ./bin/ruby-cli-daemon.sh rake --version

TODO

  • restart when Gemfile.lock changes
  • support debian
  • support sending INT from Ctrl+C instead of TERM
  • show Killed: 9 when process was sig-killed

Author

Michael Grosser
michael@grosser.it
License: MIT
Build Status coverage