Skip to content

Add timeout parameter to worker_request#420

Merged
rdaum merged 2 commits intomainfrom
rd/worker_request_timeout
May 20, 2025
Merged

Add timeout parameter to worker_request#420
rdaum merged 2 commits intomainfrom
rd/worker_request_timeout

Conversation

@rdaum
Copy link
Copy Markdown
Owner

@rdaum rdaum commented May 20, 2025

Changes worker_request so that the second argument is a list of payload-specific arguments, and the third is for extra (universalish) parameters like timeout.

https://github.com/rdaum/moor/issues

@rdaum rdaum requested a review from Copilot May 20, 2025 01:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds an optional timeout parameter to the worker_request function, allowing outbound requests to specify a duration. Key changes include updating the data structures and function signatures across the RPC, kernel, and workers modules, and modifying the HTTP client configuration in the curl-worker.

  • Added an optional timeout field in worker_request message types and task suspensions.
  • Updated function signatures and pattern matching in both synchronous and asynchronous worker loops.
  • Modified the HTTP client initialization in the curl-worker to honor the timeout parameter.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Removed file; verify if its removal is intentional.
crates/rpc/rpc-common/src/worker.rs Added timeout parameter to the worker message enum.
crates/rpc/rpc-async-client/src/worker_loop.rs Updated worker loop functions to pass along the timeout parameter.
crates/kernel/src/vm/mod.rs Updated TaskSuspend::WorkerRequest variant to include timeout.
crates/kernel/src/vm/builtins/bf_server.rs Modified bf_worker_request to support an optional timeout argument.
crates/kernel/src/tasks/workers.rs Added timeout field to the WorkerRequest struct.
crates/kernel/src/tasks/scheduler.rs Updated scheduler pattern matching to pass along timeout values.
crates/daemon/src/workers_server.rs Adjusted request processing to extract the timeout parameter.
crates/curl-worker/src/main.rs Configured HTTP client to use the timeout if provided.
Comments suppressed due to low confidence (1)

package.json:1

  • The removal of package.json appears unrelated to the addition of the timeout parameter and may affect project configuration; please confirm if the removal is intentional.
Entire file removed

Comment thread crates/daemon/src/workers_server.rs
@rdaum rdaum merged commit 486af24 into main May 20, 2025
12 checks passed
@rdaum rdaum deleted the rd/worker_request_timeout branch June 17, 2025 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants