-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add callback for fail-rs #50
Conversation
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
6ce0398
to
dc78bf1
Compare
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
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.
I mean, if you store the member as Arc<dyn Fn()>
you don't need to impose that extra Box
from users.
Signed-off-by: Little-Wallace <bupt2013211450@gmail.com>
F: Fn() + Send + Sync + 'static, | ||
{ | ||
let mut registry = REGISTRY.registry.write().unwrap(); | ||
let p = registry |
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.
Reuse set
instead.
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.
It may be difficult... They are different.
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.
Got it.
Awesome! |
Signed-off-by: Little-Wallace bupt2013211450@gmail.com
I want to add a new kind of action for
fail-rs
, which can help TiKV be able to stop at some statement and call onecallback
function that set by tests. This feature will help use more convenient to deal with some tests which need to wait for a while, because we can pass a callback tofail_point
to notify test-thread to avoid waiting.