How to use the aenum.UniqueEnum function in aenum

To help you get started, we’ve selected a few aenum examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github radiasoft / sirepo / sirepo / runner / __init__.py View on Github external
import sirepo.mpi
import sirepo.srdb
import subprocess
import sys
import threading
import time

#: Configuration
cfg = None

# Map of jid to instance
_job_map = pkcollections.Dict()

_job_map_lock = threading.RLock()

class State(aenum.UniqueEnum):
    INIT = 1
    START = 2
    KILL = 3
    RUN = 4
    STOP = 5

_JOB_CLASSES = ('background', 'celery', 'docker', 'container')

_JOB_CLASS_DEFAULT = _JOB_CLASSES[0]

#: how long to wait before assuming thread that created job is dead.
INIT_TOO_LONG_SECS = 5

# how long to wait after first kill (TERM) to second kill (KILL)
KILL_TIMEOUT_SECS = 3
github radiasoft / sirepo / sirepo / runner.py View on Github external
import subprocess
import sys
import threading
import time
import uuid

#: Configuration
cfg = None

# Map of jid to instance
_job_map = pkcollections.Dict()

_job_map_lock = threading.RLock()


class State(aenum.UniqueEnum):
    INIT = 1
    START = 2
    KILL = 3
    RUN = 4
    STOP = 5

# how long to wait before assuming thread that created
# job is dead.
_INIT_TOO_LONG_SECS = 5

# time expected between created and running
_DOCKER_CREATED_TOO_LONG_SECS = _INIT_TOO_LONG_SECS

# how long to wait after first kill (TERM) to second kill (KILL)
_KILL_TIMEOUT_SECS = 3

aenum

Advanced Enumerations (compatible with Python's stdlib Enum), NamedTuples, and NamedConstants

BSD-2-Clause
Latest version published 2 years ago

Package Health Score

73 / 100
Full package analysis