= \Fishwife
== Description
A hard working threaded HTTP 1.1 Rack server for JRuby using
{Jetty}[http://www.eclipse.org/jetty/] 9. \Fishwife deploys
and operates like other Ruby HTTP servers/rack handlers such as
Mongrel or Puma. No Java legacy war files (e.g. warbler) required.
As compared to similar projects, most notably
{Mizuno}[https://github.com/matadon/mizuno]
from which it was originally forked, \Fishwife offers the following
unique features:
-
Depends on the {rjack-jetty}[http://rjack.gravitext.com/jetty] gem
which closely tracks the upstream Jetty project. You can test and
control the version of Jetty you use, for example via Bundler,
independent of the \Fishwife release.
-
\Fishwife may itself be embedded in your own custom server/launcher
where you have total control over JVM options like heap size, number
of threads, and other initialization/configuration details. For an
example, see:
{boxed-geminabox}[https://github.com/dekellum/boxed-geminabox#readme]
and notes in {#6}[https://github.com/dekellum/fishwife/issues/6].
-
Logging is unified across Jetty, \Fishwife, and your application via
rjack-slf4j and on to any supported output adapter
(see {Logging}[#label-Logging] below).
-
Includes \Rack 1.5
{Hijacking}[http://www.rubydoc.info/github/rack/rack/file/SPEC#Hijacking]
support for asynchronous response (after headers) streaming via
Jetty's (Servlets 3.1) asynchronous implementation.
-
Rack output streaming is optimized in a custom java extension.
-
Simple foreground server. Compatible with several real process
monitors (see {Process Monitoring}[#label-Process+Monitoring] below).
== Synopsis
To use \Fishwife with your \Rack app and config.ru:
gem install fishwife
cd /path/to/my/rack/app
Then:
fishwife
-or-
rackup -s Fishwife
See also:
- Fishwife::HttpServer::new supported options
- example/config.ru
- Notes below on Logging and Process Monitoring
== Logging
\Fishwife requires
{rjack-slf4j}[http://rjack.gravitext.com/slf4j/RJack/SLF4J.html] which
provides a unified interface for Java/Ruby logging. Jetty auto-detect
SLF4J's presence and logs there. A logging output provider must also
be loaded. The fishwife script will load
{rjack-logback}[http://rjack.gravitext.com/logback/RJack/Logback.html]
if found or otherwise fall back to rjack-slf4j/simple
. If you are
starting \Fishwife through some other means than the fishwife script, you
will need to load an output provider (see linked docs and notes in
{#6}[https://github.com/dekellum/fishwife/issues/6]).
== Process Monitoring
We assume this isn't your only production Ruby or Java server and
don't include any one-off or half-baked process control and monitoring
features. Note that Unix-like fork(2) is not safe on the JVM and thus
from JRuby so its not practical to support a fishwife --daemon
flag. \Fishwife simply logs to STDERR by default. Instead consider
using:
== Building from Source and Contributing
You'll need a working Java 8+ JDK (with javac) and recent JRuby 1.7.x
or 9.x on your PATH. Then:
jruby -S gem install rjack-tarpit -v'~> 2.1'
jruby -S gem install bundler
jruby -S bundle install
jruby -S bundle exec rake test
This above is intentionally pedantic to hopefully minimize any
confusion.
== License
Copyright (c) 2011-2018 David Kellum
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You
may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License.
=== Mizuno
Copyright (c) 2010-2011 Don Werve
Licensed under the Apache Public License, version 2.0.
=== Jetty
Jetty is dual-licensed under the
{Eclipse and Apache open-source licenses}[http://www.eclipse.org/jetty/licenses.php],
and its development is hosted by the
{Eclipse Foundation}[http://www.eclipse.org/jetty/].