mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
feat: Stabilize Deno.TcpConn.setNoDelay() and Deno.TcpConn.setKeepAlive() (#17003)
This commit stabilizes following APIs: - `Deno.TcpConn.setNoDelay()` - `Deno.TcpConn.setKeepAlive()`
This commit is contained in:
parent
392cca87a8
commit
f9db129bdf
5 changed files with 8 additions and 18 deletions
|
@ -100,12 +100,12 @@
|
|||
}
|
||||
|
||||
class TcpConn extends Conn {
|
||||
setNoDelay(nodelay = true) {
|
||||
return ops.op_set_nodelay(this.rid, nodelay);
|
||||
setNoDelay(noDelay = true) {
|
||||
return ops.op_set_nodelay(this.rid, noDelay);
|
||||
}
|
||||
|
||||
setKeepAlive(keepalive = true) {
|
||||
return ops.op_set_keepalive(this.rid, keepalive);
|
||||
setKeepAlive(keepAlive = true) {
|
||||
return ops.op_set_keepalive(this.rid, keepAlive);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
14
ext/net/lib.deno_net.d.ts
vendored
14
ext/net/lib.deno_net.d.ts
vendored
|
@ -185,19 +185,13 @@ declare namespace Deno {
|
|||
/** @category Network */
|
||||
export interface TcpConn extends Conn {
|
||||
/**
|
||||
* **UNSTABLE**: new API, see https://github.com/denoland/deno/issues/13617.
|
||||
*
|
||||
* Enable/disable the use of Nagle's algorithm.
|
||||
*
|
||||
* @param [nodelay=true]
|
||||
* @param [noDelay=true]
|
||||
*/
|
||||
setNoDelay(nodelay?: boolean): void;
|
||||
/**
|
||||
* **UNSTABLE**: new API, see https://github.com/denoland/deno/issues/13617.
|
||||
*
|
||||
* Enable/disable keep-alive functionality.
|
||||
*/
|
||||
setKeepAlive(keepalive?: boolean): void;
|
||||
setNoDelay(noDelay?: boolean): void;
|
||||
/** Enable/disable keep-alive functionality. */
|
||||
setKeepAlive(keepAlive?: boolean): void;
|
||||
}
|
||||
|
||||
/** @category Network */
|
||||
|
|
|
@ -514,7 +514,6 @@ pub fn op_set_nodelay(
|
|||
rid: ResourceId,
|
||||
nodelay: bool,
|
||||
) -> Result<(), AnyError> {
|
||||
super::check_unstable(state, "Deno.Conn#setNoDelay");
|
||||
let resource: Rc<TcpStreamResource> =
|
||||
state.resource_table.get::<TcpStreamResource>(rid)?;
|
||||
resource.set_nodelay(nodelay)
|
||||
|
@ -526,7 +525,6 @@ pub fn op_set_keepalive(
|
|||
rid: ResourceId,
|
||||
keepalive: bool,
|
||||
) -> Result<(), AnyError> {
|
||||
super::check_unstable(state, "Deno.Conn#setKeepAlive");
|
||||
let resource: Rc<TcpStreamResource> =
|
||||
state.resource_table.get::<TcpStreamResource>(rid)?;
|
||||
resource.set_keepalive(keepalive)
|
||||
|
|
|
@ -36,7 +36,6 @@ impl op_set_nodelay {
|
|||
rid: ResourceId,
|
||||
nodelay: bool,
|
||||
) -> Result<(), AnyError> {
|
||||
super::check_unstable(state, "Deno.Conn#setNoDelay");
|
||||
let resource: Rc<TcpStreamResource> = state
|
||||
.resource_table
|
||||
.get::<TcpStreamResource>(rid)?;
|
||||
|
|
|
@ -3,7 +3,6 @@ pub fn op_set_nodelay(
|
|||
rid: ResourceId,
|
||||
nodelay: bool,
|
||||
) -> Result<(), AnyError> {
|
||||
super::check_unstable(state, "Deno.Conn#setNoDelay");
|
||||
let resource: Rc<TcpStreamResource> =
|
||||
state.resource_table.get::<TcpStreamResource>(rid)?;
|
||||
resource.set_nodelay(nodelay)
|
||||
|
|
Loading…
Reference in a new issue