Add async interfaces.#1067
Conversation
Remove unneeded async from virtual methods.
Cherry pick to beta success |
Cherry pick to beta success |
Cherry pick to beta success |
| GXHttpHandler gxWebProc = handler as GXHttpHandler; | ||
| if (gxWebProc != null && gxWebProc.GetAsyncEnabledInternal()) |
There was a problem hiding this comment.
Just a small syntax sugar. This could be:
if (handler is GXHttpHandler gxWebProc && gxWebProc.GetAsyncEnabledInternal())
| public virtual Task ComponentRestoreStateAsync(string sPPrefix, string sPSFPrefix) | ||
| { | ||
| return Task.CompletedTask; | ||
| } | ||
| public virtual Task ComponentProcessAsync(string sPPrefix, string sPSFPrefix, string sEvt) | ||
| { | ||
| return Task.CompletedTask; | ||
| } | ||
| public virtual Task ComponentPrepareAsync(Object[] parms) | ||
| { | ||
| return Task.CompletedTask; | ||
| } | ||
| public virtual Task ComponentStartAsync() | ||
| { | ||
| return Task.CompletedTask; | ||
| } | ||
| public virtual Task ComponentDrawAsync() | ||
| { | ||
| return Task.CompletedTask; | ||
| } |
There was a problem hiding this comment.
Just wondering if these new async methods should call their non async counterparts, in case they're not overridden in a derived class.
| public virtual Task<short> ExecuteStartEventAsync() | ||
| { | ||
| return Task.FromResult<short>(0); | ||
| } | ||
| public virtual Task RenderHtmlContentAsync() | ||
| { | ||
| return Task.CompletedTask; | ||
| } | ||
| public virtual Task DispatchEventsAsync() | ||
| { | ||
| return Task.CompletedTask; | ||
| } |
There was a problem hiding this comment.
Just wondering if these new async methods should call their non async counterparts, in case they're not overridden in a derived class.
| protected virtual async Task ExecuteImplAsync() | ||
| { | ||
| await ExecutePrivateAsync(); | ||
| } |
There was a problem hiding this comment.
What's the difference between ExecutePrivate and ExecuteImpl and their async counterparts? Do we need both the Private and the Impl methods?
There was a problem hiding this comment.
These two execute methods exist so the generated Execute call can go through the derived class.
The public entry-point Execute method in the generated objects calls ExecuteImpl in the base class, which then calls the generated ExecutePrivate.
We couldn't change the signature of the public Execute method for compatibility reasons, so this structure allows the execution flow to be extended while preserving backward compatibility.
| public virtual Task<string> GetResponseAsync(string sGXDynURL) | ||
| { | ||
| return Task.FromResult(string.Empty); | ||
| } |
There was a problem hiding this comment.
Just wondering if these new async methods should call their non async counterparts, in case they're not overridden in a derived class.
Support DynAjaxEvent async interface.
Cherry pick to beta success |
No description provided.