44
55from abc import ABC , abstractmethod
66from collections .abc import Container , Iterator
7- from typing import Any , Optional , Union
7+ from typing import Any , Optional , Union , TypeAlias
88
99from xcube .constants import EXTENSION_POINT_DATA_STORES
1010from xcube .util .extension import Extension , ExtensionPredicate , ExtensionRegistry
@@ -691,8 +691,19 @@ def deregister_data(self, data_id: str):
691691 """
692692
693693
694- class PreloadedDataStore (DataStore ):
694+ class Preloaded (DataStore ):
695695 """A preload data store is a multable data store which contains the preload handle.
696+ This class solely acts as a protocol description or marker interface for `DataStore`
697+ instances returned from another data store's `preload_data` method.
698+
699+ The data stores returned from `preload_data` are not required to directly implement this interface.
700+ However, their instances must provide an attribute `preload_handle` of type `PreloadHandle`
701+ that is used to represent the pre-loading process and interact with it.
702+
703+ This approach helps make the source code more understandable even though instances
704+ of this class are not used at runtime. Instead, a different subclass of
705+ `DataStore` or `MutableDataStore` that includes this additional property is
706+ returned.
696707
697708 Instances of this class are returned by the ``DataStore.preload_data()`` method.
698709 """
@@ -704,3 +715,6 @@ def preload_handle(self) -> PreloadHandle:
704715 Implementors of this interface may use a `ExecutorPreloadHandle` or consider
705716 returning a `NullPreloadHandle` if the progress is not observable.
706717 """
718+
719+
720+ PreloadedDataStore : TypeAlias = DataStore | Preloaded
0 commit comments