Skip to content

Commit

Permalink
Issue #460 use typing.NamedTuple for _Backend container in job_manage…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
soxofaan committed Aug 25, 2023
1 parent 6f656b3 commit fd5dee6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions openeo/extra/job_management.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import collections
import contextlib
import datetime
import json
import logging
import time
from pathlib import Path
from typing import Callable, Dict, Optional, Union
from typing import Callable, Dict, Optional, Union, NamedTuple

import pandas as pd
import requests
Expand All @@ -20,8 +19,13 @@
_log = logging.getLogger(__name__)


# Container for backend info/settings
_Backend = collections.namedtuple("_Backend", ["get_connection", "parallel_jobs"])
class _Backend(NamedTuple):
"""Container for backend info/settings"""

# callable to create a backend connection
get_connection: Callable[[], Connection]
# Maximum number of jobs to allow in parallel on a backend
parallel_jobs: int


MAX_RETRIES = 5
Expand Down

0 comments on commit fd5dee6

Please sign in to comment.