[upd] plankton

This commit is contained in:
roydfalk 2024-08-21 15:17:53 +02:00
parent 2135dfff1f
commit baffdf891c
2 changed files with 306 additions and 156 deletions

View file

@ -3005,13 +3005,13 @@ declare namespace lib_plankton.http {
* @author fenris <frass@greenscale.de> * @author fenris <frass@greenscale.de>
*/ */
enum enum_method { enum enum_method {
get = "get",
post = "post",
patch = "patch",
put = "put",
delete = "delete",
options = "options", options = "options",
head = "head" head = "head",
get = "get",
delete = "delete",
post = "post",
put = "put",
patch = "patch"
} }
/** /**
* @author fenris <frass@greenscale.de> * @author fenris <frass@greenscale.de>
@ -3305,16 +3305,28 @@ declare namespace lib_plankton.server {
* @author fenris * @author fenris
*/ */
type type_subject = { type type_subject = {
host: string;
port: int; port: int;
handle: ((input: string, metadata?: type_metadata) => Promise<string>); threshold: (null | float);
handle: ((input: Buffer, metadata?: type_metadata) => Promise<string>);
serverobj: any; serverobj: any;
}; };
/** /**
* @author fenris * @author fenris
*/ */
function make(port: int, handle: ((input: string, metadata?: type_metadata) => Promise<string>)): type_subject; function make(handle: ((input: string, metadata?: type_metadata) => Promise<string>), options?: {
host?: string;
port?: int;
threshold?: (null | float);
}): type_subject;
/** /**
* @author fenris * @author fenris
* @deprecated
*/
function make_old(port: int, handle: ((input: string, metadata?: type_metadata) => Promise<string>)): type_subject;
/**
* @author fenris
* @see https://nodejs.org/api/net.html#serverlistenport-host-backlog-callback
*/ */
function start(subject: type_subject): Promise<void>; function start(subject: type_subject): Promise<void>;
/** /**
@ -3334,7 +3346,10 @@ declare namespace lib_plankton.server {
/** /**
* @author fenris * @author fenris
*/ */
constructor(port: int, handle: ((input: string) => Promise<string>)); constructor(handle: ((input: Buffer, metadata?: type_metadata) => Promise<string>), options?: {
host?: string;
port?: int;
});
/** /**
* @author fenris * @author fenris
*/ */

File diff suppressed because it is too large Load diff