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

Specify a custom message for a running task #32

Open
altso opened this issue Jul 1, 2020 · 0 comments
Open

Specify a custom message for a running task #32

altso opened this issue Jul 1, 2020 · 0 comments

Comments

@altso
Copy link

altso commented Jul 1, 2020

Could you please advise on the right way to specify a value to be displayed when task is in Running state? Given the example below, I'm trying to show something like "#N/A Calculating..." for the first 5 seconds until value is returned. The default behavior is to show it as "#N/A".

[ExcelAsyncFunction]
public static async Task<object> GetValueIn5Seconds()
{
    await Task.Delay(5000);
    return 42;
}

It seems like it's easily achievable with IObservable, but I'd prefer using Task if possible.

I was considering intercepting the registration process and implicitly converting Task to IObservable with a first emitted value "#N/A Calculating..." Any thoughts on that approach? Is there a better way to do it?

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

1 participant