dapla_metadata.datasets.external_sources package¶
dapla_metadata.datasets.external_sources.external_sources module¶
- class GetExternalSource(executor)[source]¶
Bases:
ABC,Generic[T]Abstract base class for retrieving data from external sources asynchronously.
This class provides methods to initiate an asynchronous data retrieval operation, check its status, and retrieve the result once the operation completes. Subclasses must implement the _fetch_data_from_external_source method to define how data is fetched from the specific external source.
- Parameters:
executor (ThreadPoolExecutor)
- check_if_external_data_is_loaded()[source]¶
Check if the thread getting the external data has finished running.
- Return type:
bool- Returns:
True if the data fetching operation is complete, False otherwise.
- retrieve_external_data()[source]¶
Retrieve the result of the data fetching operation.
This method checks if the asynchronous data fetching operation has completed. If the operation is finished, it returns the result. Otherwise, it returns None.
- Return type:
Optional[TypeVar(T)]- Returns:
The result of the data fetching operation if it is complete or None if the operation has not yet finished.