-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: rework the pool server classes #328
Conversation
ServerRequestKind::AddOp { entry_point, op, origin } => { | ||
match self.get_pool(entry_point) { | ||
Ok(mempool) => { | ||
let mempool = Arc::clone(mempool); | ||
tokio::spawn(async move { | ||
let resp = match mempool.add_operation(origin, op).await { | ||
Ok(hash) => Ok(ServerResponse::AddOp { hash }), | ||
Err(e) => Err(e.into()), | ||
}; | ||
if let Err(e) = req.response.send(resp) { | ||
tracing::error!("Failed to send response: {:?}", e); | ||
} | ||
}); | ||
continue; | ||
}, | ||
Err(e) => Err(e), | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only long running task, so we need to spawn it to make space for the actor thread to continue processing requests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Some early comments since this is a draft.
49809d9
to
0412b5c
Compare
7210e9c
to
c9e9c6c
Compare
4ec2ff7
to
3e21b0e
Compare
23c3285
to
f489dca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incredible work! Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good work on on this
f489dca
to
49dd555
Compare
No description provided.