Skip to content

Add timeout parameter to run_in_thread function#5213

Closed
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1745975175-add-timeout-to-run-in-thread
Closed

Add timeout parameter to run_in_thread function#5213
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1745975175-add-timeout-to-run-in-thread

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

Add timeout parameter to run_in_thread function

This PR adds a new timeout parameter to the run_in_thread function, which allows setting a maximum execution time for the thread. After the specified timeout is exceeded, an asyncio.TimeoutError is raised.

Changes

  • Added an optional timeout parameter to run_in_thread
  • Updated the implementation to use asyncio.wait_for for handling timeouts
  • Added documentation for the new parameter
  • Added unit tests for the new functionality

Testing

  • Added unit tests for the timeout functionality
  • Verified that all existing tests pass

Link to Devin run: https://app.devin.ai/sessions/808e952e52174d8c9f2f26ac94c239bc
Requested by: Alek Petuskey (alek@reflex.dev)

Co-Authored-By: Alek Petuskey <alek@pynecone.io>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 30, 2025

CodSpeed Performance Report

Merging #5213 will improve performances by 5.31%

Comparing devin/1745975175-add-timeout-to-run-in-thread (21ab114) with main (26f1a7b)

Summary

⚡ 1 improvements
✅ 11 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
test_compile_stateful[_simple_page] 256.5 µs 243.5 µs +5.31%

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.

0 participants