... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
diff --git a/lib/lotus/loader.rb b/lib/lotus/loader.rb | |
index e038d7f..9221840 100644 | |
--- a/lib/lotus/loader.rb | |
+++ b/lib/lotus/loader.rb | |
@@ -23,7 +23,6 @@ module Lotus | |
load_configuration! | |
load_frameworks! | |
load_application! | |
- finalize! | |
end |
git clone [email protected]:lotus/lotus.git | |
git clone [email protected]:lotus/model.git | |
git clone [email protected]:lotus/controller.git | |
git clone [email protected]:lotus/view.git | |
git clone [email protected]:lotus/router.git | |
git clone [email protected]:lotus/helpers.git | |
git clone [email protected]:lotus/utils.git | |
sdoc -o doc/lotus -T direct --exclude="CHANGELOG.md" --exclude="LICENSE.txt" --exclude="LICENSE.md" --exclude="CONTRIBUTING.md" --exclude="test" --exclude="Gemfile*" --exclude=".*gemspec" --exclude="Rakefile" --no-dry-run -t lotus -a lotus | |
sdoc -o doc/model -T direct --exclude="CHANGELOG.md" --exclude="LICENSE.txt" --exclude="LICENSE.md" --exclude="CONTRIBUTING.md" --exclude="test" --exclude="Gemfile*" --exclude=".*gemspec" --exclude="Rakefile" model |
# register services | |
Application.register :session do | |
SessionStore.new(store: Application.lookup(:database_store)) | |
end | |
Application.register :database_store do | |
# code to initialize database storage for session | |
end | |
# inject session service into every action |
require 'rubygems' | |
require 'redis' | |
r = Redis.new | |
r.config("SET","maxmemory","2000000") | |
r.config("SET","maxmemory-policy","allkeys-lru") | |
r.config("SET","maxmemory-samples",1000) | |
r.config("RESETSTAT") | |
r.flushall |
### | |
# Execute tests in parallel using multiple processes. Uses DRb to communicate | |
# between processes over a unix socket. | |
gem 'minitest', '~> 5.1.0' | |
require 'minitest' | |
require 'minitest/spec' | |
require 'minitest/mock' | |
require 'drb' | |
require 'drb/unix' |
# Hack to change the Rails cookie serializer from Marshal to JSON and therefore allow the session | |
# to be shared between different languages but also avoid that someone knowing the | |
# cookie secret key could execute arbitrary code on the server by unmarshalling | |
# modified Ruby code added to the session/permanent cookie. | |
# | |
# Note that all users will beed to login again since both the remember me cookie and the session cookies | |
# won't be valid. Note also that the remember me cookie is tested multiple times per request even when it fails. | |
# for performance reasons you might want to delete it if these extra cycles are too costly for you. | |
# | |
# Rails 4 (not tested on Rails 3). |
require 'action_dispatch/middleware/session/redis_store' | |
module ActionDispatch | |
module Session | |
class SignedRedisStore < ActionDispatch::Session::RedisStore | |
def load_session(env) | |
stale_session_check! do | |
get_session(env, | |
cookie_jar(env)[@key] | |
) |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Bootstrap Masonry Template</title> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="style.css"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700"> |