Commit Graph

26 Commits

Author SHA1 Message Date
Muki Kiboigo
ee8fbbce41 properly notify and serve from cache on revalidation 2026-06-08 07:14:17 -07:00
Muki Kiboigo
c808015c47 Cache Revalidation 2026-06-08 07:14:17 -07:00
Muki Kiboigo
dc6fc5b353 add Cache.revalidate + supporting logic 2026-06-08 07:14:16 -07:00
Muki Kiboigo
ffcdcc6e09 add optional ctx to runNextTick 2026-06-05 07:25:29 -07:00
Karl Seguin
37a846d91d remove unused imports 2026-06-01 22:42:39 +08:00
Muki Kiboigo
a4c535370b add optional Abort handler to runNextTick 2026-05-25 11:05:11 -07:00
Muki Kiboigo
00ccb5ed52 NextTickNode is owned by Transfer 2026-05-25 10:52:51 -07:00
Muki Kiboigo
f4de603cf5 properly deinit transfer on runNextTick 2026-05-25 10:09:53 -07:00
Muki Kiboigo
766e163ef1 properly handle cancellation of next tick events 2026-05-25 10:06:50 -07:00
Muki Kiboigo
a295a7a21a various changes to properly track next ticked transfers 2026-05-25 10:06:50 -07:00
Muki Kiboigo
cd5e5ece40 serve from cache on next client tick 2026-05-25 10:06:49 -07:00
Karl Seguin
1cdd2bb324 Cleanup Transfer flag
Replaces 4 boolean flags with a state. Makes it easier to figure out what the
state of the transfer is, and removes the possibility of inconsistent flags
.e.g queued + loop_owned.

loop_owned -> state != .created
_queued -> state == .queued
_perform -> state == .completing
aborted -> state == .aborted
2026-05-20 20:37:21 +08:00
Karl Seguin
a5162bea8f Cleanup HttpClient.Transfer
This is just moving fields around. The end result is that there's a
`transfer.req` and a `transfer.res`.

On the Request side, we use to have a nested `params: RequestParam` resulting
in a lot of `transfer.req.params.url`. This is now `transfer.req.url`. On the
Response side, we had the exact opposite: response fields splattered directly
in the transfer, `transfer.response_header`. This is now `transfer.res.header`.

There is now an HttpClient.Response, which is the actual final response (which
could be for a transfer or something else, e.g the cache). And an
HttpClient.Transfer.Response which captures the inflight response data (and is
one of the polymorphic variants of the HttpClient.Response). Probably still not
ideal, but I'm not sure how to make it cleaner, and even if this is just an
intermediary step, I consider it an small win.
2026-05-15 12:55:47 +08:00
Muki Kiboigo
940976b6a7 properly disable cache on Network.setCacheDisabled 2026-05-14 09:03:51 -07:00
Muki Kiboigo
ac863c7e2b add Network.requestServedFromCache 2026-05-13 21:47:47 -07:00
Karl Seguin
50b126b402 fix cachelayer hit path 2026-05-13 07:14:44 +08:00
Karl Seguin
82a4fc752b HttpClient Improvements
1 - Track owner of a request (for simpler / more accurate abort (TBD))

2 - Create Transfer upfront, make everything work on Transfer (not Request)
    This helps remove ambiguity about cleanup and simplifies layers. For example
    Robots request is just another normal request, not a special case. This gives
    everything a stable address (the *Transfer which can be looked up by id)
2026-05-12 19:26:24 +08:00
Muki Kiboigo
e8c9acd310 fix request arena leak on CacheLayer hit 2026-04-28 09:48:23 -07:00
Muki Kiboigo
3fe774fbfb pass error all the way up to Layer chain to clean 2026-04-28 07:01:42 -07:00
Muki Kiboigo
c719a522b8 use lightpanda module log in layers 2026-04-28 07:01:42 -07:00
Muki Kiboigo
e56036fb50 use Request Arena in CacheLayer 2026-04-28 07:01:41 -07:00
Muki Kiboigo
dddd0dfb90 fix request id mismatch on cdp 2026-04-28 07:01:40 -07:00
Muki Kiboigo
9c826159a0 crude InterceptionLayer 2026-04-28 07:01:40 -07:00
Muki Kiboigo
e988e49136 remove Context and thread *Client 2026-04-28 07:01:39 -07:00
Muki Kiboigo
46d0b34c54 add RequestParams and SyncRequest 2026-04-28 07:01:39 -07:00
Muki Kiboigo
5dd15aa2cf use layers for Cache, Robots and WebBotAuth 2026-04-28 07:01:39 -07:00