# Copyright 2023-2025 Dom Sekotill <dom.sekotill@kodo.org.uk>
"""
Provides `Request`, a simple implementation of `konnect.curl.abc.RequestProtocol`
"""
from typing import IO
import pycurl
from .abc import ConfigHandle
from .abc import GetInfoHandle
[docs]
class Request:
"""
A simple implementation of `konnect.curl.abc.RequestProtocol`
"""
url: str
destination: IO[bytes]
def __init__(self, url: str, destination: IO[bytes]) -> None:
self.url = url
self.destination = destination
[docs]
def has_update(self) -> bool:
"""
Return whether calling `get_update()` will return a value or raise LookupError
"""
return False
[docs]
def get_update(self) -> None:
"""
Return a waiting update or raise LookupError if there is none
See `has_update()` for checking for waiting updates.
"""
raise LookupError
[docs]
def completed(self, handle: GetInfoHandle, /) -> None:
"""
Indicate that Curl has completed processing the handle and return a final response
"""