Skip to content

Commit

Permalink
deploy: e4e41df
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic committed May 15, 2023
1 parent 76317f7 commit 89b2adc
Show file tree
Hide file tree
Showing 3 changed files with 290 additions and 54 deletions.
12 changes: 10 additions & 2 deletions config.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,16 @@ <h1 class="title">Module <code>server.config</code></h1>
{
&#34;ADDRESS&#34;: &#34;&#34;,
&#34;PORT&#34;: 8001,
&#34;NAME&#34;: None,
&#34;PROTOCOL&#34;: &#34;QDataStreamProtocol&#34;,
&#34;PROXY&#34;: False,
},
{
&#34;ADDRESS&#34;: &#34;&#34;,
&#34;PORT&#34;: 8002,
&#34;PROTOCOL&#34;: &#34;SimpleJsonProtocol&#34;
&#34;NAME&#34;: None,
&#34;PROTOCOL&#34;: &#34;SimpleJsonProtocol&#34;,
&#34;PROXY&#34;: False
}
]
self.LOG_LEVEL = &#34;DEBUG&#34;
Expand Down Expand Up @@ -287,12 +291,16 @@ <h2 class="section-title" id="header-classes">Classes</h2>
{
&#34;ADDRESS&#34;: &#34;&#34;,
&#34;PORT&#34;: 8001,
&#34;NAME&#34;: None,
&#34;PROTOCOL&#34;: &#34;QDataStreamProtocol&#34;,
&#34;PROXY&#34;: False,
},
{
&#34;ADDRESS&#34;: &#34;&#34;,
&#34;PORT&#34;: 8002,
&#34;PROTOCOL&#34;: &#34;SimpleJsonProtocol&#34;
&#34;NAME&#34;: None,
&#34;PROTOCOL&#34;: &#34;SimpleJsonProtocol&#34;,
&#34;PROXY&#34;: False
}
]
self.LOG_LEVEL = &#34;DEBUG&#34;
Expand Down
61 changes: 50 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -348,21 +348,31 @@ <h1 id="legal">Legal</h1>
async def listen(
self,
address: tuple[str, int],
protocol_class: type[Protocol] = QDataStreamProtocol
name: Optional[str] = None,
protocol_class: type[Protocol] = QDataStreamProtocol,
proxy: bool = False,
) -&gt; ServerContext:
&#34;&#34;&#34;
Start listening on a new address.

# Params
- `address`: Tuple indicating the host, port to listen on.
- `name`: String used to identify this context in log messages. The
default is to use the `protocol_class` name.
- `protocol_class`: The protocol class implementation to use.
- `proxy`: Boolean indicating whether or not to use the PROXY protocol.
See: https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
&#34;&#34;&#34;
if not self.started:
await self.start_services()

ctx = ServerContext(
f&#34;{self.name}[{protocol_class.__name__}]&#34;,
f&#34;{self.name}[{name or protocol_class.__name__}]&#34;,
self.connection_factory,
list(self.services.values()),
protocol_class
)
await ctx.listen(*address)
await ctx.listen(*address, proxy=proxy)

self.contexts.add(ctx)

Expand Down Expand Up @@ -7176,21 +7186,31 @@ <h3>Inherited members</h3>
async def listen(
self,
address: tuple[str, int],
protocol_class: type[Protocol] = QDataStreamProtocol
name: Optional[str] = None,
protocol_class: type[Protocol] = QDataStreamProtocol,
proxy: bool = False,
) -&gt; ServerContext:
&#34;&#34;&#34;
Start listening on a new address.

# Params
- `address`: Tuple indicating the host, port to listen on.
- `name`: String used to identify this context in log messages. The
default is to use the `protocol_class` name.
- `protocol_class`: The protocol class implementation to use.
- `proxy`: Boolean indicating whether or not to use the PROXY protocol.
See: https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
&#34;&#34;&#34;
if not self.started:
await self.start_services()

ctx = ServerContext(
f&#34;{self.name}[{protocol_class.__name__}]&#34;,
f&#34;{self.name}[{name or protocol_class.__name__}]&#34;,
self.connection_factory,
list(self.services.values()),
protocol_class
)
await ctx.listen(*address)
await ctx.listen(*address, proxy=proxy)

self.contexts.add(ctx)

Expand Down Expand Up @@ -7237,32 +7257,51 @@ <h3>Inherited members</h3>
<h3>Methods</h3>
<dl>
<dt id="server.ServerInstance.listen"><code class="name flex">
<span>async def <span class="ident">listen</span></span>(<span>self, address: tuple[str, int], protocol_class: type[<a title="server.protocol.protocol.Protocol" href="protocol/protocol.html#server.protocol.protocol.Protocol">Protocol</a>] = server.protocol.qdatastream.QDataStreamProtocol) ‑> <a title="server.servercontext.ServerContext" href="servercontext.html#server.servercontext.ServerContext">ServerContext</a></span>
<span>async def <span class="ident">listen</span></span>(<span>self, address: tuple[str, int], name: Optional[str] = None, protocol_class: type[<a title="server.protocol.protocol.Protocol" href="protocol/protocol.html#server.protocol.protocol.Protocol">Protocol</a>] = server.protocol.qdatastream.QDataStreamProtocol, proxy: bool = False) ‑> <a title="server.servercontext.ServerContext" href="servercontext.html#server.servercontext.ServerContext">ServerContext</a></span>
</code></dt>
<dd>
<div class="desc"><p>Start listening on a new address.</p></div>
<div class="desc"><p>Start listening on a new address.</p>
<h1 id="params">Params</h1>
<ul>
<li><code>address</code>: Tuple indicating the host, port to listen on.</li>
<li><code>name</code>: String used to identify this context in log messages. The
default is to use the <code>protocol_class</code> name.</li>
<li><code>protocol_class</code>: The protocol class implementation to use.</li>
<li><code>proxy</code>: Boolean indicating whether or not to use the PROXY protocol.
See: <a href="https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt">https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt</a></li>
</ul></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">async def listen(
self,
address: tuple[str, int],
protocol_class: type[Protocol] = QDataStreamProtocol
name: Optional[str] = None,
protocol_class: type[Protocol] = QDataStreamProtocol,
proxy: bool = False,
) -&gt; ServerContext:
&#34;&#34;&#34;
Start listening on a new address.

# Params
- `address`: Tuple indicating the host, port to listen on.
- `name`: String used to identify this context in log messages. The
default is to use the `protocol_class` name.
- `protocol_class`: The protocol class implementation to use.
- `proxy`: Boolean indicating whether or not to use the PROXY protocol.
See: https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
&#34;&#34;&#34;
if not self.started:
await self.start_services()

ctx = ServerContext(
f&#34;{self.name}[{protocol_class.__name__}]&#34;,
f&#34;{self.name}[{name or protocol_class.__name__}]&#34;,
self.connection_factory,
list(self.services.values()),
protocol_class
)
await ctx.listen(*address)
await ctx.listen(*address, proxy=proxy)

self.contexts.add(ctx)

Expand Down
Loading

0 comments on commit 89b2adc

Please sign in to comment.