Commit Graph

9 Commits

Author SHA1 Message Date
Mia
4b79ee1276 Net: Expose response data to consumers
Headers are useful for a couple of Net consumers (rate limit data, that sort of thing.)
2023-11-28 12:27:38 -06:00
Guangcong Luo
f47e38c5ad Support building TS declarations
`./build decl` now builds TS declarations for everything exported by
`sim/`. Unfortunately, the built TS declarations still refer to global
types, so some things still have `any` type, but it's much better than
nothing.
2021-06-09 17:51:49 -05:00
Mia
76c10841ea
Lib: Add an index file for all exports (#7972) 2021-01-31 18:00:19 -08:00
Guangcong Luo
160efc9898 Fix crash after failed Net request 2020-07-02 11:25:34 -07:00
Guangcong Luo
713f914d75 Fix Net error behavior
A lot of Net functions returned Promises that would not reliably
resolve/reject if a Net request failed. This fixes it so they should
now all reliably reject on request failure.

(Yes, this fixes the ladder issues and memory leak in Main.)
2020-06-10 16:08:48 -07:00
Guangcong Luo
1e5b5ab465 Update Streams API with pushEnd/writeEnd
Previously, ending a read stream was `stream.push(null)`, and ending a
write stream was `stream.end()`. This was often confusing, and so now,
these are consistently `stream.pushEnd()` and `stream.writeEnd()`.

This refactor already found a bug in which `stream.end()` was used
where `stream.push(null)` should have been.

Also in this refactor: By default, `pushError` ends the stream. You can
pass `true` as the second parameter if the error is recoverable (the
stream shouldn't end).
2020-06-10 16:07:24 -07:00
Guangcong Luo
b53480b364 Fix memory leak in ladders-remote 2020-06-09 18:31:29 -07:00
Guangcong Luo
b99c8db5d2 Fix Net library 2020-06-05 10:38:27 -07:00
Mia
cf42c6269a
Add a library for making HTTP/S requests (#6744) 2020-06-04 11:53:58 -07:00