From: Eric Wong <e@80x24.org>
To: yahns-public@yhbt.net
Subject: [PATCH] nodoc internals
Date: Tue, 15 Dec 2015 08:23:51 +0000 [thread overview]
Message-ID: <20151215082351.10765-1-e@80x24.org> (raw)
We do not expose any sort of API beyond what's in the config file
manpage to our users. Do not mislead them into thinking we
currently have a stable API (though I'm considering one).
This avoids wasting disk space and installation time for users who
do not have a: "gem: --no-ri --no-rdoc" line in their ~/.gemrc
---
lib/yahns.rb | 19 ++++++++++++-------
lib/yahns/config.rb | 4 ++++
lib/yahns/http_client.rb | 6 +-----
lib/yahns/proxy_pass.rb | 2 +-
lib/yahns/sendfile_compat.rb | 4 ++--
5 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/lib/yahns.rb b/lib/yahns.rb
index 641959c..bbf86f2 100644
--- a/lib/yahns.rb
+++ b/lib/yahns.rb
@@ -14,9 +14,13 @@
Unicorn.__send__(:remove_const, sym) if Unicorn.const_defined?(sym)
end
-# yahns exposes no user-visible API outside of the config file
+# yahns exposes no user-visible API outside of the config file.
+# See http://yahns.yhbt.net/yahns_config.txt for the config documentation
+# and http://yahns.yhbt.net/ for the homepage.
# Internals are subject to change.
-module Yahns # :nodoc:
+
+module Yahns
+ # :stopdoc:
# We populate this at startup so we can figure out how to reexecute
# and upgrade the currently running instance of yahns
# Unlike unicorn, this Hash is NOT a stable/public interface.
@@ -57,15 +61,16 @@ module Yahns # :nodoc:
# try to use the monotonic clock in Ruby >= 2.1, it is immune to clock
# offset adjustments and generates less garbage (Float vs Time object)
begin
- Process.clock_gettime(Process::CLOCK_MONOTONIC)
- def self.now
- Process.clock_gettime(Process::CLOCK_MONOTONIC)
+ def self.now # :nodoc:
+ Process.clock_gettime(Process::CLOCK_MONOTONIC) # :nodoc:
end
rescue NameError, NoMethodError
- def self.now # Ruby <= 2.0
- Time.now.to_f
+ def self.now # :nodoc:
+ Time.now.to_f # Ruby <= 2.0
end
end
+
+ # :startdoc:
end
# FIXME: require lazily
diff --git a/lib/yahns/config.rb b/lib/yahns/config.rb
index e39115c..2b71fe5 100644
--- a/lib/yahns/config.rb
+++ b/lib/yahns/config.rb
@@ -18,6 +18,10 @@ def initialize(config_file = nil)
@config_file = config_file
@block = nil
config_reload!
+
+ # FIXME: we shouldn't have this at all when we go Unicorn 5-only
+ Unicorn::HttpParser.respond_to?(:keepalive_requests=) and
+ Unicorn::HttpParser.keepalive_requests = 0xffffffff
end
def _check_in_block(ctx, var)
diff --git a/lib/yahns/http_client.rb b/lib/yahns/http_client.rb
index db53587..8a341f9 100644
--- a/lib/yahns/http_client.rb
+++ b/lib/yahns/http_client.rb
@@ -2,11 +2,7 @@
# Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
class Yahns::HttpClient < Kgio::Socket # :nodoc:
- NULL_IO = StringIO.new("")
-
- # FIXME: we shouldn't have this at all when we go Unicorn 5-only
- Unicorn::HttpParser.respond_to?(:keepalive_requests=) and
- Unicorn::HttpParser.keepalive_requests = 0xffffffff
+ NULL_IO = StringIO.new('') # :nodoc:
include Yahns::HttpResponse
QEV_FLAGS = Yahns::Queue::QEV_RD # used by acceptor
diff --git a/lib/yahns/proxy_pass.rb b/lib/yahns/proxy_pass.rb
index 9512318..728ab3e 100644
--- a/lib/yahns/proxy_pass.rb
+++ b/lib/yahns/proxy_pass.rb
@@ -10,7 +10,7 @@
require_relative 'proxy_http_response'
class Yahns::ProxyPass # :nodoc:
- class ReqRes < Kgio::Socket
+ class ReqRes < Kgio::Socket # :nodoc:
attr_writer :resbuf
attr_accessor :proxy_trailers
diff --git a/lib/yahns/sendfile_compat.rb b/lib/yahns/sendfile_compat.rb
index da2a9ec..bd79c0c 100644
--- a/lib/yahns/sendfile_compat.rb
+++ b/lib/yahns/sendfile_compat.rb
@@ -2,7 +2,7 @@
# Copyright (C) 2013-2015 all contributors <yahns-public@yhbt.net>
# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
-module Yahns::SendfileCompat
+module Yahns::SendfileCompat # :nodoc:
def trysendfile(io, offset, count)
return 0 if count == 0
count = 0x4000 if count > 0x4000
@@ -22,6 +22,6 @@ def trysendfile(io, offset, count)
end
end
-class IO
+class IO # :nodoc:
include Yahns::SendfileCompat
end
--
EW
reply other threads:[~2015-12-15 8:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/yahns/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151215082351.10765-1-e@80x24.org \
--to=e@80x24.org \
--cc=yahns-public@yhbt.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/yahns.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).