Created
November 3, 2011 17:39
-
-
Save amfeng/1337150 to your computer and use it in GitHub Desktop.
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
# Want to have Membership separate, so can plug in different Membership modules on the fly | |
# Check number of members in the beginning, when find winner, consult current state of member table OR have vote_status = currently voting | |
module VoteMasterProtocol | |
state do | |
interface input :begin_vote, [:ballotid, :content, :ratio] | |
interface output, :result, [:ballotid, :result] | |
end | |
end | |
module VoteAgentProtocol | |
state do | |
interface input, :cast_vote, [:ballotid] => [:response] | |
end | |
end | |
module VoteProtocol | |
state do | |
# TODO: Do we want to use multicast? Timeouts? | |
# 1) Keep as channels, except duplicate multicast functionality | |
# 2) Use multicast, have two sets of ballot/vote interfaces, and | |
# code the bridging ourselves | |
# 3) | |
interface input, :ballot, [:ballotid, :content] | |
interface input, :vote, [:ballotid, :response] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment