As per Nginx documentation, the key directives of proxy_http_version
and proxy_set_header
need to be set as per below:
upstream backend {
server 127.0.0.1:8080;
keepalive 8;
}
server {
‽Erlang/OTP 19 [erts-8.3] [64-bit] [smp:8:8] [async-threads:10] | |
Interactive Elixir (1.4.4) - press Ctrl+C to exit (type h() ENTER for help) | |
iex(1)> c("tst_gen.ex") | |
[TstGen] | |
iex(2)> | |
nil | |
iex(3)> {:ok, pid} = TstGen.start_link | |
{:ok, #PID<0.88.0>} | |
iex(4)> |
require 'sidekiq/api' | |
# 1. Clear retry set | |
Sidekiq::RetrySet.new.clear | |
# 2. Clear scheduled jobs | |
Sidekiq::ScheduledSet.new.clear |
require 'connection_pool' | |
def open_pool | |
pool = ConnectionPool.new { File.open('/dev/null', 'r') } | |
class << pool | |
def fileno | |
with { |fd| fd.fileno } | |
end | |
end | |
pool |
defmodule MyApp.Mixfile do | |
use Mix.Project | |
def project do | |
[app: :my_app, | |
version: get_version, | |
elixir: "~> 1.0", | |
elixirc_paths: elixirc_paths(Mix.env), | |
compilers: Mix.compilers, | |
build_embedded: Mix.env == :prod, |
As per Nginx documentation, the key directives of proxy_http_version
and proxy_set_header
need to be set as per below:
upstream backend {
server 127.0.0.1:8080;
keepalive 8;
}
server {
# gem install benchmark-ips | |
require "benchmark/ips" | |
path = "lib/rubycritic/cli/options.rb" | |
Benchmark.ips do |x| | |
x.report("read + each_line") { File.read(path).each_line.count } | |
x.report("open + each_line") { File.open(path, "r").each_line.count } |
# Makefile template for a shared library in C | |
# https://www.topbug.net/blog/2019/10/28/makefile-template-for-a-shared-library-in-c-with-explanations/ | |
CC = gcc # C compiler | |
CFLAGS = -fPIC -Wall -Wextra -O2 -g # C flags | |
LDFLAGS = -shared # linking flags | |
RM = rm -f # rm command | |
TARGET_LIB = libtarget.so # target lib | |
SRCS = main.c src1.c src2.c # source files |
$ irb -r ./select_server | |
>> client.puts "hi" | |
=> nil | |
>> client.puts "bye" | |
=> nil | |
>> client.close | |
=> nil | |
>> exit |