Skip to content

Instantly share code, notes, and snippets.

@samueleresca
Last active March 25, 2021 14:17
Show Gist options
  • Save samueleresca/e4d156162b7feb6f9625e1230e10d422 to your computer and use it in GitHub Desktop.
Save samueleresca/e4d156162b7feb6f9625e1230e10d422 to your computer and use it in GitHub Desktop.
from src._heartbeat_history import _HeartbeatHistory
from typing import Optional
class _State:
"""
Represents the accrual failure detector's state. It is wraps the _HeartbeatHistory and the latest (most recent) timestamp.
See: https://github.com/akka/akka/blob/0326e113879f08f39ca80667512cc960f267c81b/akka-remote/src/main/scala/akka/remote/PhiAccrualFailureDetector.scala#L120
Attributes:
history: The heartbeat history wrapped into the state
timestamp: Optional; The latest timestamp to wrap in the state.
"""
def __init__(self, history: _HeartbeatHistory, timestamp: Optional[float] = None):
"""
Constructor of _State class.
"""
self.history = history
self.timestamp = timestamp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment