My favorites
|
Sign in
ruby-roger-useful-functions
useful programs
Project Home
Downloads
Wiki
Issues
Source
Checkout
|
Browse
|
Changes
|
r260
Source path:
svn
/
trunk
/
asymy
/
fibers
/
mongrel_test
/
ramaze19_here
/
start.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env ruby
require 'rubygems'
$:.unshift '/Users/rogerpack/dev/ramaze_git/lib'
$:.unshift File.dirname(__FILE__) + '/../'
require 'ramaze'
def dbg; require 'ruby-debug'; debugger; end
# to see that this works, ruby start.rb, then
# compare the timing of
# time ab -n 50 -c 10 http://127.0.0.1:7000/mixed_old_school
# time ab -n 50 -c 10 http://127.0.0.1:7000/mixed_new_school
use_evented_and_fibered = true
if use_evented_and_fibered
# in order to use evented with 1.9, you actually need to go into your mongrel itself and require 'swiftcore/evented_mongrel' at the end of it,
# and then require '../fibered_mongrel.rb' after that
# this to overcome a bug in Ramaze
# in my own code, I set it to load these files if I had defined certain constants
EVENTED_MONGREL = true
EVENTED_FIBERED_MONGREL = true
# this causes the err on 1.9 require 'swiftcore/evented_mongrel'
# also note that
# you'll need to go into ramaze and discourage it from starting a thread with each response [since we use fibers to supplant threads]
# i.e. go into lib/ramaze/adapter/base.rb
# and change def respond [at the bottom]
# to not spawn them
#
# def respond(env)
# if false #Global.server.respond_to?(:thread) and Global.server.thread == Thread.current # changed line
# ...
end
# require all controllers and models
acquire __DIR__/:controller/'*'
acquire __DIR__/:model/'*'
Ramaze.start :adapter => :evented_mongrel, :port => 7000 # you may need the svn version of ramaze for :evented_mongrel to work here
Show details
Hide details
Change log
r113
by rogerpack2005 on Jul 03, 2008
Diff
ramaze init
Go to:
...mongrel_test/asymy_fiber_stop.rb
..._test/connection_pool_fibered.rb
.../mongrel_test/fibered_mongrel.rb
...l_test/mongrel_with_db_pooled.rb
...ibers/mongrel_test/ramaze19_here
...el_test/ramaze19_here/controller
...ramaze19_here/controller/main.rb
...mongrel_test/ramaze19_here/model
...ongrel_test/ramaze19_here/public
...el_test/ramaze19_here/public/css
...here/public/css/ramaze_error.css
...maze19_here/public/dispatch.fcgi
...ramaze19_here/public/favicon.ico
...rel_test/ramaze19_here/public/js
...amaze19_here/public/js/jquery.js
.../ramaze19_here/public/ramaze.png
...grel_test/ramaze19_here/ru.start
.../mongrel_test/ramaze19_here/spec
..._test/ramaze19_here/spec/main.rb
...grel_test/ramaze19_here/start.rb
.../mongrel_test/ramaze19_here/view
...t/ramaze19_here/view/error.xhtml
...t/ramaze19_here/view/index.xhtml
...st/ramaze19_here/view/page.xhtml
...rel_test/test_mongrel_with_db.rb
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 1559 bytes, 45 lines
View raw file
File properties
svn:executable
*
Hosted by