Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove timeout in awaitable #651

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions wgpu/backends/wgpu_native/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,11 @@ class WgpuAwaitable:
truely async manner, as well as to support a synchronous version of them.
"""

def __init__(self, title, callback, finalizer, poll_function=None, timeout=5.0):
def __init__(self, title, callback, finalizer, poll_function=None):
self.title = title # for context in error messages
self.callback = callback # only used to prevent it from being gc'd
self.finalizer = finalizer # function to finish the result
self.poll_function = poll_function # call this to poll wgpu
self.maxtime = time.perf_counter() + float(timeout)
self.result = None

def set_result(self, result):
Expand All @@ -258,7 +257,7 @@ def set_error(self, error):

def _is_done(self):
self.poll_function()
return self.result is not None or time.perf_counter() > self.maxtime
return self.result is not None

def _finish(self):
try:
Expand Down
Loading