diff options
author | bptato <nincsnevem662@gmail.com> | 2023-04-30 12:19:24 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-04-30 12:19:24 +0200 |
commit | a02c408f933aea6f405ed3c64ab151b01b33ae9e (patch) | |
tree | 4946f6b13da782a92a1ecc0f03402abacf2614b3 /src/display/client.nim | |
parent | 05b64a1d8fa95381d756231f665c0b8c79787b67 (diff) | |
download | chawan-a02c408f933aea6f405ed3c64ab151b01b33ae9e.tar.gz |
WIP fetch
Diffstat (limited to 'src/display/client.nim')
-rw-r--r-- | src/display/client.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/display/client.nim b/src/display/client.nim index 38a868dc..59557f36 100644 --- a/src/display/client.nim +++ b/src/display/client.nim @@ -86,6 +86,9 @@ proc `=destroy`(client: var ClientObj) = proc doRequest(client: Client, req: Request): Response {.jsfunc.} = return client.loader.doRequest(req) +proc fetch(client: Client, req: Request): Promise[Response] {.jsfunc.} = + return client.loader.fetch(req) + proc interruptHandler(rt: JSRuntime, opaque: pointer): int {.cdecl.} = let client = cast[Client](opaque) if client.console == nil or client.console.tty == nil: return @@ -465,6 +468,7 @@ proc launchClient*(client: Client, pages: seq[string], ctype: Option[string], du dump = true client.ssock = initServerSocket(false) client.selector = newSelector[Container]() + client.loader.registerFun = proc(fd: int) = client.selector.registerHandle(fd, {Read}, nil) client.selector.registerHandle(int(client.dispatcher.forkserver.estream.fd), {Read}, nil) client.pager.launchPager(tty) client.console = newConsole(client.pager, tty) |