diff --git a/snakemake_storage_plugin_s3/__init__.py b/snakemake_storage_plugin_s3/__init__.py index 0fb2a78..59651c8 100644 --- a/snakemake_storage_plugin_s3/__init__.py +++ b/snakemake_storage_plugin_s3/__init__.py @@ -21,6 +21,7 @@ IOCacheStorageInterface, get_constant_prefix, ) +from snakemake_interface_storage_plugins.common import Operation # Optional: @@ -145,6 +146,24 @@ def __post_init__(self): verify=False, # TODO required? ) + def use_rate_limiter(self) -> bool: + """Return False if no rate limiting is needed for this provider.""" + return False + + def default_max_requests_per_second(self) -> float: + """Return the default maximum number of requests per second for this storage + provider.""" + ... + + def rate_limiter_key(self, query: str, operation: Operation): + """Return a key for identifying a rate limiter given a query and an operation. + + This is used to identify a rate limiter for the query. + E.g. for a storage provider like http that would be the host name. + For s3 it might be just the endpoint URL. + """ + ... + @classmethod def is_valid_query(cls, query: str) -> StorageQueryValidationResult: """Return whether the given query is valid for this storage provider.""" @@ -229,7 +248,7 @@ def get_inventory_parent(self) -> Optional[str]: def local_suffix(self) -> str: return self._local_suffix - def close(self): + def cleanup(self): # Close any open connections, unmount stuff, etc. pass