Created
October 18, 2018 10:12
-
-
Save keroro520/830dcd1dadf236cfbe31bf4b9d9cbbfd to your computer and use it in GitHub Desktop.
executor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 执行线程 | |
stage = "idle" | |
LOOP { | |
CASE stage { | |
"idle" => state = stage_idle(); | |
"executing_proposal" => state = stage_executing_proposal(); | |
} | |
} | |
FUNCTION stage_executing_proposal() { | |
LOOP { | |
IF an interruption event come { | |
handle_interrupt() | |
RETURN "idle" | |
} ELSE IF already done processing proposal { | |
handle_done_proposal() | |
RETURN "idle" | |
} ELSE { | |
continue to process next transaction | |
} | |
} | |
} | |
FUNCTION stage_idle() { | |
SWITCH { | |
receive ConsensusBlock event => ... | |
receive SyncBlock event => ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment