File: config30.ru

package info (click to toggle)
uwsgi 2.0.31-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,624 kB
  • sloc: ansic: 87,072; python: 7,010; cpp: 1,133; java: 708; perl: 678; sh: 585; ruby: 555; makefile: 148; xml: 130; cs: 121; objc: 37; php: 28; erlang: 20; javascript: 11
file content (68 lines) | stat: -rw-r--r-- 1,120 bytes parent folder | download | duplicates (10)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
require 'stringio'
require 'uwsgidsl'



signal 17,'mule5' do |signum|
end

puts UWSGI::VERSION
puts UWSGI::NUMPROC
puts UWSGI::HOSTNAME

puts UWSGI::OPT.inspect

timer 2 do |signum|
  puts "ciao sono un dsl ruby: #{signum} #{UWSGI::OPT.inspect}"
end

timer 1,'mule1' do |signum|
  puts "1 second elapsed (signum #{signum})"
end

filemon '/tmp' do |signum|
  puts "/tmp has been modified"
end

cron 5,-1,-1,-1,-1 do |signum|
  puts "cron ready #{signum}"
end

cron 58,-1,-1,-1,-1 do |signum|
  puts "cron ready #{signum}"
end

postfork do
  puts "fork() called"
end

rpc 'pippo' do
  "i am an rpc function"
end

rpc 'pluto' do |x,y|
  "i am another rpc function #{x} #{y}"
end

begin
  foo_func
rescue
end

puts UWSGI.cache_exists('nilkey')
puts UWSGI.cache_exists?('nilkey')

UWSGI.cache_set!('foobar_key?a=1', UWSGI::OPT.inspect)
begin
puts UWSGI.cache_get(nil)
rescue
end
puts UWSGI.cache_get('foobar_key?a=1')


run lambda { |env| 
  puts env.inspect
  UWSGI.setprocname("i am the uWSGI rack plugin")
  UWSGI.signal(17)
  [200, {'Content-Type'=>'text/plain'}, StringIO.new("Hello World! #{UWSGI.mem.inspect}\n")] 
}