Support for Asynchronous Calls to Aspose.Words REST API

Hi,

After 1 year still no reply?

We have the exact same requirement, launch the merge or conversion process, and have Aspose store the result somewhere and notify us when the process is ready.

We have large documents to produce in batch, and having a thread waiting until finished is an anti-pattern in any technology.

We are using Aspose Words Cloud with a simple ExecuteMailMergeOnline and/or ConvertDocument.

Kind regards,
Michel.

@michel.liesmons

Thanks for your inquiry. I am afraid the feature needs a major revamp in the API, so it is still pending. However, we have linked your post to our internal ticket. We will notify you as soon as it is resolved.

@michel.liesmons

Please note we have recently introduced asynchronous calls in Aspose.Words Cloud SDKs. Hopefully, it helps your scenario otherwise share your requirements with more details.

Hi Ahmad,

I do not see what is new, we have been using this already for a long time (see snippet below).

We recently switched to a naked HTTP request to use our own HTTP client configuration and better control the timeout from our side too.
This seems to work, but still is not the async model we would like to see, the await still blocks until the stream is returned. Executing this in a separate thread does also work, but is not a best practice in a backend API: REST calls should not take e.g. half an hour before returning to the caller.
We are now executing this blocking call from a K8s container.
Executing it in an App Service or Function kills the HTTP connection after a time smaller than it takes to generate the report, we have no control over this App Service timeout.

In fact, we are not looking for language-level async support but for a true async process.

I want to pass the request to an Aspose endpoint, and control should return immediately to the caller (even with an await).

The request should be enriched with a property that allows us to specify a callback URL (hook), that Aspose calls when the document is ready and stored on e.g. some cloud blob storage.
When Aspose performs the callback, it should contain a (signed) download URL for us to call and get the generated document.

Alternatively, instead of this hook, we could also pass a signed URL in the request that Aspose calls to directly store the generated document in e.g. our blob storage. Both Azure and AWS support this approach. An event handler on our side could pick it up.

Kr,
Michel.

    private async Task<IO.Stream> ExecuteMailMergeOnline(ExecuteMailMergeOnlineRequest request)
    {
        //var output = await WordsApi.ExecuteMailMergeOnline(request);

        var accessToken = await AccessToken();
        var httpRequest = request.CreateHttpRequest(WordsApiConfiguration, null);
        var response = await Http.SendHttpRequest(httpRequest, accessToken);
        var output = await request.DeserializeResponse(response) as IO.Stream;

        return output;
    }
1 Like

@michel.liesmons

Thanks for your feedback and detailed requirements. We have logged a feature request WORDSCLOUD-2012 in our issue tracking system and will notify you as soon we resolve it.

A post was merged into an existing topic: Add Comment to Cell in Worksheet!