Permalink
Browse files

0.8 release

  • Loading branch information...
1 parent b7c1022 commit 89f3e50adadfd2d0808bca7cab7deb9a598546a2 @rtomayko committed Jun 24, 2010
Showing with 76 additions and 13 deletions.
  1. +67 −8 man/shotgun.1
  2. +7 −3 man/shotgun.1.ronn
  3. +2 −2 shotgun.gemspec
View
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.6.42
.\" http://github.com/rtomayko/ronn/tree/0.6.6-36-gb67d494
.
-.TH "SHOTGUN" "1" "June 2010" "Shotgun 0.7" ""
+.TH "SHOTGUN" "1" "June 2010" "Shotgun 0.8" ""
.
.SH "NAME"
\fBshotgun\fR \- reloading rack development server
@@ -49,8 +49,12 @@ Open browser at http://\fIhost\fR:\fIport\fR/ immediately after the server is st
Ruby environment related options:
.
.TP
+\fB\-r\fR, \fB\-\-require\fR \fIlibrary\fR
+Require \fIlibrary\fR before loading the application and starting the server\. This can be used to load a portion of the application code in the master process so it doesn\'t need to be loaded in the child\. See \fIPRELOADING\fR][] for more information on this approach\.
+.
+.TP
\fB\-e\fR, \fB\-\-eval\fR \fIcommand\fR
-Evaluate arbitrary \fIcommand\fR within the Ruby interpreter\. \fIcommand\fR is evaluated as program arguments are parsed\. Multiple \fB\-e\fR arguments are allowed\.
+Evaluate arbitrary \fIcommand\fR within the shotgun master Ruby interpreter\. \fIcommand\fR is evaluated as program arguments are parsed\. Multiple \fB\-e\fR arguments are allowed\.
.
.TP
\fB\-d\fR, \fB\-\-debug\fR
@@ -64,10 +68,6 @@ Enable verbose mode without printing version message at the beginning\. It sets
\fB\-I\fR, \fB\-\-include\fR \fIpath\fR
Add \fIpath\fR to the Ruby load path (\fB$LOAD_PATH\fR)\. May be used more than once\.
.
-.TP
-\fB\-r\fR, \fB\-\-require\fR \fIlibrary\fR
-Require \fIlibrary\fR before loading the application and starting the server\.
-.
.P
Miscellaneous:
.
@@ -79,6 +79,49 @@ Show usage message and exit\.
\fB\-\-version\fR
Show the Rack version and exit\.
.
+.SH "PRELOADING"
+It\'s possible to load support libraries and portions of the application in the shotgun master process to reduce the amount of work that needs to be done for each request in worker processes\. There\'s two ways of accomplishing this: either by specifying one or more \fB\-\-require\fR (\fB\-r\fR) arguments or through the use of a \fBshotgun\.rb\fR file\.
+.
+.P
+During start up, shotgun looks for a \fBshotgun\.rb\fR or \fBconfig/shotgun\.rb\fR file\. If either file is found, it\'s loaded into the shotgun master process\. Code at the top\-level of the \fBshotgun\.rb\fR is run once on startup, so just require whatever you want to preload\. It\'s also possible to register callbacks to run before each request in either the master or child worker process:
+.
+.TP
+\fBafter_fork {\fR \fIstuff\fR \fB}\fR
+Run \fIstuff\fR in the shotgun child worker process immediately after forking\. Any files or socket connections opened in the master process should be closed / re\-established by an \fBafter_fork\fR block\.
+.
+.TP
+\fBbefore_fork {\fR \fIstuff\fR \fB}\fR
+Run \fIstuff\fR in the shotgun master process on each request before forking the child worker process\. This is typically less useful than \fBafter_fork\fR, but provided for completeness\.
+.
+.P
+Example \fBconfig/shotgun\.rb\fR file from the main github\.com rails project:
+.
+.IP "" 4
+.
+.nf
+
+# make sure the load path includes RAILS_ROOT
+ENV[\'RAILS_ROOT\'] ||= File\.expand_path(\'\.\./\.\.\', __FILE__)
+$:\.unshift ENV[\'RAILS_ROOT\']
+
+# bring in the base rails environment and some libraries
+require \'config/environment\'
+require \'google\-charts\'
+require \'aws\-s3\'
+
+# disable Rails\'s built in class reloading
+Rails\.configuration\.cache_classes = true
+
+# reset database and redis connections in workers
+after_fork do
+ ActiveRecord::Base\.establish_connection
+ CHIMNEY\.client = $redis
+end
+.
+.fi
+.
+.IP "" 0
+.
.SH "INSTALLING"
Shotgun is distributed as a gem package at rubygems\.org:
.
@@ -102,10 +145,26 @@ Fork and report issues at github\.com:
.
.SH "VERSION HISTORY"
.
-.SS "Version 0\.7 (unreleased)"
+.SS "Version 0\.8 (2010 June 24)"
+.
+.IP "\(bu" 4
+\fIhttp://github\.com/rtomayko/shotgun/compare/0\.7\.\.\.0\.8\fR
+.
+.IP "\(bu" 4
+Preloading support\. The \fBshotgun\.rb\fR or \fBconfig/shotgun\.rb\fR file is loaded at startup and may require libraries and register callbacks for fork events\. See the section on \fIPRELOADING\fR\.
+.
+.IP "\(bu" 4
+Fix starting with the Thin handler (\fBshotgun \-s thin\fR)
+.
+.IP "\(bu" 4
+Actually include the shotgun(1) roff manual\.
+.
+.IP "" 0
+.
+.SS "Version 0\.7 (2010 June 22)"
.
.IP "\(bu" 4
-\fIhttp://github\.com/rtomayko/shotgun/compare/0\.6\.\.\.master\fR
+\fIhttp://github\.com/rtomayko/shotgun/compare/0\.6\.\.\.0\.7\fR
.
.IP "\(bu" 4
Static files now served from the shotgun master process, making shotgun tolerable for apps with many/unbundled static assets\.
View
@@ -148,13 +148,17 @@ Fork and report issues at github.com:
## VERSION HISTORY
-### Version 0.8 (unreleased)
+### Version 0.8 (2010 June 24)
- * <http://github.com/rtomayko/shotgun/compare/0.7...master>
+ * <http://github.com/rtomayko/shotgun/compare/0.7...0.8>
* Preloading support. The `shotgun.rb` or `config/shotgun.rb` file is
loaded at startup and may require libraries and register callbacks
- for fork events.
+ for fork events. See the section on [PRELOADING][].
+
+ * Fix starting with the Thin handler (`shotgun -s thin`)
+
+ * Actually include the shotgun(1) roff manual.
### Version 0.7 (2010 June 22)
View
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = 'shotgun'
- s.version = '0.7'
- s.date = '2010-06-22'
+ s.version = '0.8'
+ s.date = '2010-06-23'
s.description = "reloading rack development server"
s.summary = s.description

0 comments on commit 89f3e50

Please sign in to comment.