Module dev_scheduler_server.erl¶
A long-lived server that schedules messages for a process.
Description¶
It acts as a deliberate 'bottleneck' to prevent the server accidentally assigning multiple messages to the same slot.
Function Index¶
assign/3* | Assign a message to the next slot. |
commit_assignment/2* | Commit to the assignment using all of our appropriate wallets. |
commitment_wallets/2* | Determine the appropriate list of keys to use to commit assignments for a process. |
do_assign/3* | Generate and store the actual assignment message. |
info/1 | Get the current slot from the scheduling server. |
maybe_inform_recipient/5* | Potentially inform the caller that the assignment has been scheduled. |
new_proc_test/0* | Test the basic functionality of the server. |
next_hashchain/3* | Create the next element in a chain of hashes that links this and prior assignments. |
schedule/2 | Call the appropriate scheduling server to assign a message. |
server/1* | The main loop of the server. |
start/3 | Start a scheduling server for a given computation. |
stop/1 |
Function Details¶
assign/3 *¶
assign(State, Message, ReplyPID) -> any()
Assign a message to the next slot.
commit_assignment/2 *¶
commit_assignment(BaseAssignment, State) -> any()
Commit to the assignment using all of our appropriate wallets.
commitment_wallets/2 *¶
commitment_wallets(ProcMsg, Opts) -> any()
Determine the appropriate list of keys to use to commit assignments for a process.
do_assign/3 *¶
do_assign(State, Message, ReplyPID) -> any()
Generate and store the actual assignment message.
info/1¶
info(ProcID) -> any()
Get the current slot from the scheduling server.
maybe_inform_recipient/5 *¶
maybe_inform_recipient(Mode, ReplyPID, Message, Assignment, State) -> any()
Potentially inform the caller that the assignment has been scheduled. The main assignment loop calls this function repeatedly at different stages of the assignment process. The scheduling mode determines which stages trigger an update.
new_proc_test/0 *¶
new_proc_test() -> any()
Test the basic functionality of the server.
next_hashchain/3 *¶
next_hashchain(HashChain, Message, Opts) -> any()
Create the next element in a chain of hashes that links this and prior assignments.
schedule/2¶
schedule(AOProcID, Message) -> any()
Call the appropriate scheduling server to assign a message.
server/1 *¶
server(State) -> any()
The main loop of the server. Simply waits for messages to assign and returns the current slot.
start/3¶
start(ProcID, Proc, Opts) -> any()
Start a scheduling server for a given computation.
stop/1¶
stop(ProcID) -> any()