Skip to content
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

COPromise 的 cancle 调用没有效果。 #110

Open
szmichaelyb opened this issue Jul 29, 2021 · 1 comment
Open

COPromise 的 cancle 调用没有效果。 #110

szmichaelyb opened this issue Jul 29, 2021 · 1 comment

Comments

@szmichaelyb
Copy link

szmichaelyb commented Jul 29, 2021

如题,协程的取消Cancle需要怎么使用,目前调用没有效果?

/**
 Cancel the job.
 
 @discussion If you want a `COPromise` be cancellable, you must make the job cancel in `onCancel:`.
 */
- (void)cancel;


/**
 Set the onCancelBlock.

 @param onCancelBlock will execute on the promise cancelled.
 */
- (void)onCancel:(COPromiseOnCancelBlock _Nullable )onCancelBlock;

目前,如下两种方式,均没有效果: cancle 并没被调用,没有日志输出。

image

@NianJi
Copy link
Collaborator

NianJi commented Sep 26, 2021

应该先设置 onCancel, 再调用 cancel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants