Skip to content

Specify a custom message for a running task #32

Description

@altso

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions