Skip to content

Add new settings for timeout and max_samples so we can awake on data. - #38

Merged
cboulay merged 1 commit into
mainfrom
cboulay/new_pull_args
Jul 20, 2026
Merged

Add new settings for timeout and max_samples so we can awake on data.#38
cboulay merged 1 commit into
mainfrom
cboulay/new_pull_args

Conversation

@cboulay

@cboulay cboulay commented Jul 20, 2026

Copy link
Copy Markdown
Member

This PR enables a significant reduction in CPU usage.

  • self._pull is called in asyncio.to_thread so time spent in liblsl does not block
  • The user can parameterize the pull's pull_timeout (defaults to 0.005) to spend more time in no-GIL liblsl
  • The user can parameterize the inlet's max_pull_samples (defaults to None) to no-GIL wait for liblsl to return that many samples.
  • When both pull_timeout and max_pull_samples are provided, the call to pull will return when either condition is hit.

… Call pull from asyncio to_thread. Reduces CPU usage.
@cboulay
cboulay merged commit 9d742cd into main Jul 20, 2026
14 checks passed
@cboulay
cboulay deleted the cboulay/new_pull_args branch July 20, 2026 04:37
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.

1 participant