| 798 | |
| 799 | |
| 800 | Future<PromiseResponse> promise( |
| 801 | size_t quorum, |
| 802 | const Shared<Network>& network, |
| 803 | uint64_t proposal, |
| 804 | const Option<uint64_t>& position) |
| 805 | { |
| 806 | if (position.isNone()) { |
| 807 | ImplicitPromiseProcess* process = |
| 808 | new ImplicitPromiseProcess( |
| 809 | quorum, |
| 810 | network, |
| 811 | proposal); |
| 812 | |
| 813 | Future<PromiseResponse> future = process->future(); |
| 814 | spawn(process, true); |
| 815 | return future; |
| 816 | } else { |
| 817 | ExplicitPromiseProcess* process = |
| 818 | new ExplicitPromiseProcess( |
| 819 | quorum, |
| 820 | network, |
| 821 | proposal, |
| 822 | position.get()); |
| 823 | |
| 824 | Future<PromiseResponse> future = process->future(); |
| 825 | spawn(process, true); |
| 826 | return future; |
| 827 | } |
| 828 | } |
| 829 | |
| 830 | |
| 831 | Future<WriteResponse> write( |