Merge pull request #278 from lightpanda-io/cdp_full_async

Cdp full async
This commit is contained in:
Francis Bouvier
2024-11-01 18:14:21 +01:00
committed by GitHub
5 changed files with 95 additions and 105 deletions

View File

@@ -226,8 +226,7 @@ pub fn sendEvent(
const resp = Resp{ .method = name, .params = params, .sessionId = sessionID };
const event_msg = try stringify(alloc, resp);
defer alloc.free(event_msg);
try server.sendSync(ctx, event_msg);
try server.sendAsync(ctx, event_msg);
}
fn getParams(

View File

@@ -331,8 +331,7 @@ fn navigate(
.loaderId = ctx.state.loaderID,
};
const res = try result(alloc, msg.id, Resp, resp, msg.sessionID);
defer alloc.free(res);
try server.sendSync(ctx, res);
try server.sendAsync(ctx, res);
// TODO: at this point do we need async the following actions to be async?

View File

@@ -256,8 +256,7 @@ fn disposeBrowserContext(
// output
const res = try result(alloc, msg.id, null, .{}, null);
defer alloc.free(res);
try server.sendSync(ctx, res);
try server.sendAsync(ctx, res);
return error.DisposeBrowserContext;
}
@@ -345,8 +344,7 @@ fn closeTarget(
success: bool = true,
};
const res = try result(alloc, msg.id, Resp, Resp{}, null);
defer alloc.free(res);
try server.sendSync(ctx, res);
try server.sendAsync(ctx, res);
// Inspector.detached event
const InspectorDetached = struct {