Excel-DNA / Excel-DNA/Registration

Specify a custom message for a running task

Open
#32 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
37
Forks
19
PR merge metrics
No merged PRs in 30d

Description

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".

```cs
[ExcelAsyncFunction]
public static async Task 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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.