File: server.rbs

package info (click to toggle)
ruby-webrick 1.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 756 kB
  • sloc: ruby: 7,781; sh: 4; makefile: 4
file content (57 lines) | stat: -rw-r--r-- 1,293 bytes parent folder | download | duplicates (2)
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