blob: 74db11f8d8379bf9e28543516fdfa1492e6a1963 (
plain)
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
|
module WEBrick
class ServerError < StandardError
end
class SimpleServer
def self.start: [T] () { () -> T } -> T
end
class Daemon
def self.start: () -> void
| [T] () { () -> T } -> T
end
class GenericServer
@shutdown_pipe: [IO, IO]?
attr_reader status: :Stop | :Running | :Shutdown
attr_reader config: Hash[Symbol, untyped]
attr_reader logger: BasicLog
attr_reader tokens: Thread::SizedQueue
attr_reader listeners: Array[TCPServer| OpenSSL::SSL::SSLServer]
def initialize: (?Hash[Symbol, untyped] config, ?Hash[Symbol, untyped] default) -> void
def []: (Symbol key) -> untyped
def listen: (String address, Integer port) -> void
def start: () ?{ (TCPSocket) -> void } -> void
def stop: () -> void
def shutdown: () -> void
def run: (TCPSocket sock) -> void
private
def accept_client: (TCPServer svr) -> TCPSocket?
def start_thread: (TCPSocket sock) ?{ (TCPSocket) -> void } -> Thread
def call_callback: (Symbol callback_name, *untyped args) -> untyped
def setup_shutdown_pipe: () -> [IO, IO]
def cleanup_shutdown_pipe: ([IO, IO]? shutdown_pipe) -> void
def alarm_shutdown_pipe: [T] () { (IO) -> T } -> T?
def cleanup_listener: () -> void
end
end
|