Implement embedded Git synchronization TUI
This commit is contained in:
@@ -35,6 +35,7 @@ pub enum AuthenticationEvent {
|
||||
pub enum AuthenticationTarget {
|
||||
Entry(String),
|
||||
Workflow(Box<WorkflowSubmission>),
|
||||
Git(ironstorage::command::GitRequest),
|
||||
}
|
||||
|
||||
struct AuthenticationCompletion {
|
||||
@@ -79,6 +80,10 @@ impl AuthenticationCoordinator {
|
||||
self.request(AuthenticationTarget::Workflow(submission));
|
||||
}
|
||||
|
||||
pub fn request_git(&mut self, request: ironstorage::command::GitRequest) {
|
||||
self.request(AuthenticationTarget::Git(request));
|
||||
}
|
||||
|
||||
fn request(&mut self, target: AuthenticationTarget) {
|
||||
self.generation = self.generation.wrapping_add(1);
|
||||
let generation = self.generation;
|
||||
@@ -199,6 +204,19 @@ impl AsyncExecutor {
|
||||
.push(task);
|
||||
}
|
||||
|
||||
pub fn progress_reporter(
|
||||
&self,
|
||||
token: RequestToken,
|
||||
) -> impl Fn(ironstorage::git::GitProgressPhase) + Send + Sync + 'static {
|
||||
let sender = self.sender.clone();
|
||||
move |phase| {
|
||||
let _ignored = sender.send(AsyncResult {
|
||||
token,
|
||||
payload: Ok(AsyncPayload::GitProgress(phase)),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
pub fn drain(&self) -> impl Iterator<Item = AsyncResult> + '_ {
|
||||
self.receiver.try_iter()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user