-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b108ab
commit 9cb4ef4
Showing
6 changed files
with
4 additions
and
30 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,11 @@ | ||
use daggy::NodeIndex; | ||
use futures::{future::BoxFuture, FutureExt}; | ||
use std::{future::Future, task::Poll}; | ||
|
||
use fhevm_engine_common::types::{Handle, SupportedFheCiphertexts}; | ||
|
||
use crate::server::{InMemoryCiphertext, SyncComputeError}; | ||
use crate::server::InMemoryCiphertext; | ||
|
||
pub type DFGTaskResult = Option<InMemoryCiphertext>; | ||
|
||
#[allow(variant_size_differences)] | ||
#[derive(Clone)] | ||
pub enum DFGTaskInput { | ||
Val(SupportedFheCiphertexts), | ||
Handle(Handle), | ||
} | ||
|
||
pub struct SchedTask<'a> { | ||
pub idx: NodeIndex, | ||
pub fut: BoxFuture<'a, Result<InMemoryCiphertext, SyncComputeError>>, | ||
} | ||
|
||
impl<'a> Future for SchedTask<'a> { | ||
type Output = (NodeIndex, Result<InMemoryCiphertext, SyncComputeError>); | ||
|
||
fn poll( | ||
mut self: std::pin::Pin<&mut Self>, | ||
cx: &mut std::task::Context<'_>, | ||
) -> Poll<Self::Output> { | ||
match self.fut.poll_unpin(cx) { | ||
Poll::Pending => Poll::Pending, | ||
Poll::Ready(output) => Poll::Ready((self.idx, output)), | ||
} | ||
} | ||
} |
This file contains 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