Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cse550
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Winston Jodjana
cse550
Commits
64bb1fa8
Commit
64bb1fa8
authored
2 years ago
by
WinJ
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/timers'
parents
860c5c01
5b4f5855
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
assignment2/timers.py
+42
-0
42 additions, 0 deletions
assignment2/timers.py
with
42 additions
and
0 deletions
assignment2/timers.py
0 → 100644
+
42
−
0
View file @
64bb1fa8
from
assignment2.message
import
P1A
,
P2A
from
assignment2.paxos
import
BallotNumber
class
Timer
:
def
__init__
(
self
)
->
None
:
pass
def
__str__
(
self
)
->
str
:
return
f
"
timer:
{
self
.
__class__
.
__name__
}
"
class
P2ATimer
(
Timer
):
P2A_RETRY_MILLIS
=
100
def
__init__
(
self
,
p2a
:
P2A
)
->
None
:
super
().
__init__
()
self
.
p2a
:
P2A
=
p2a
class
HeartBeatTimer
(
Timer
):
HEARTBEAT_RETRY_MILLIS
=
20
def
__init__
(
self
)
->
None
:
super
().
__init__
()
class
HeartBeatCheckTimer
(
Timer
):
HEARTBEAT_CHECK_RETRY_MILLIS
=
100
def
__init__
(
self
,
ballot
:
BallotNumber
)
->
None
:
super
().
__init__
()
self
.
ballot
:
BallotNumber
=
ballot
class
LeaderElectionTimer
(
Timer
):
LEADER_ELECTION_TIMER
=
50
def
__init__
(
self
,
p1a
:
P1A
)
->
None
:
super
().
__init__
()
self
.
p1a
:
P1A
=
p1a
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment