Sha256: 34e75c3d56c0572230568d0cc4881c72ec8434ae7f2ec8c130267f325cf1ed63

Contents?: true

Size: 645 Bytes

Versions: 11

Compression:

Stored size: 645 Bytes

Contents

require 'sinatra/base'
require 'async/redis'
require 'async/clock'

CLIENT = Async::Redis::Client.new(Async::Redis.local_endpoint)

class MyApp < Sinatra::Base
	get "/" do
		puts "Starting BLPOP SLEEP..."
		duration = Async::Clock.measure do
			CLIENT.call "BLPOP", "SLEEP", 1
		end
		puts "Finished BLPOP SLEEP after #{duration.round(2)}s"
		
		"ok"
	end
end

use MyApp # Then, it will get to Sinatra.
run lambda {|env| [404, {}, []]} # Bottom of the stack, give 404.

# Start server like this:
# falcon --verbose serve --threaded --concurrency 1 --bind http://localhost:9292

# Test server, e.g.:
# time ab -n 64 -c 64 http://localhost:9292/

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
falcon-0.24.0 examples/redis/config.ru
falcon-0.23.0 examples/redis/config.ru
falcon-0.22.3 examples/redis/config.ru
falcon-0.22.2 examples/redis/config.ru
falcon-0.22.1 examples/redis/config.ru
falcon-0.22.0 examples/redis/config.ru
falcon-0.21.0 examples/redis/config.ru
falcon-0.20.3 examples/redis/config.ru
falcon-0.20.2 examples/redis/config.ru
falcon-0.20.1 examples/redis/config.ru
falcon-0.20.0 examples/redis/config.ru