Module glean.net.base_uploader
A base class for ping uploaders.
Classes
class BaseUploader (*args, **kwargs)
-
Expand source code
class BaseUploader(PingUploader): """ The logic for uploading pings. This leaves the actual upload implementation to the user-provided delegate. """ def do_upload( self, capable_request: "CapablePingUploadRequest", ) -> Union[ UploadResult, UploadResult.UNRECOVERABLE_FAILURE, UploadResult.RECOVERABLE_FAILURE, UploadResult.HTTP_STATUS, UploadResult.INCAPABLE, ]: """ This function triggers the actual upload. It logs the ping and calls the implementation-specific upload function. Args: capable_request (CapablePingUploadRequest): The ping upload request, locked behind a capability check. Returns: result (UploadResult): the status code of the upload response. """ return self.upload(capable_request)
The logic for uploading pings. This leaves the actual upload implementation to the user-provided delegate.
Ancestors
- PingUploader
- typing.Protocol
- typing.Generic
Subclasses
- HttpClientUploader
- glean.testing._RecordingUploader
Methods
def do_upload(self, capable_request: CapablePingUploadRequest) ‑> glean._uniffi.glean.UploadResult | glean._uniffi.glean.UploadResult.UNRECOVERABLE_FAILURE | glean._uniffi.glean.UploadResult.RECOVERABLE_FAILURE | glean._uniffi.glean.UploadResult.HTTP_STATUS | glean._uniffi.glean.UploadResult.INCAPABLE
-
Expand source code
def do_upload( self, capable_request: "CapablePingUploadRequest", ) -> Union[ UploadResult, UploadResult.UNRECOVERABLE_FAILURE, UploadResult.RECOVERABLE_FAILURE, UploadResult.HTTP_STATUS, UploadResult.INCAPABLE, ]: """ This function triggers the actual upload. It logs the ping and calls the implementation-specific upload function. Args: capable_request (CapablePingUploadRequest): The ping upload request, locked behind a capability check. Returns: result (UploadResult): the status code of the upload response. """ return self.upload(capable_request)
This function triggers the actual upload.
It logs the ping and calls the implementation-specific upload function.
Args
capable_request
:CapablePingUploadRequest
- The ping upload request, locked behind a capability check.
Returns
result (UploadResult): the status code of the upload response.
Inherited members