-
Notifications
You must be signed in to change notification settings - Fork 39
Very rough outline of plugins #495
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
base: main
Are you sure you want to change the base?
Conversation
/// <summary> | ||
/// Placeholder. | ||
/// </summary> | ||
internal class RootPlugin : Plugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would recommend making this implement the interface w/ a throw NotImplementedException
for init
|
||
public TemporalClientOptions OnCreateClient(TemporalClientOptions options); | ||
|
||
public Task<TemporalConnection> TemporalConnectAsync(TemporalClientConnectOptions options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would call this ClientConnectAsync
and other ClientCreateLazy
private IWorkerPlugin? nextWorkerPlugin; | ||
private IClientPlugin? nextClientPlugin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would recommend these be protected properties, and that they return non-null values and fail if the backing fields are null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would not recommend putting this in the Interceptors
namespace, and would recommend calling this ITemporalClientPlugin
(same two things for worker side)
|
||
namespace Temporalio.Common | ||
{ | ||
public class Plugin : IClientPlugin, IWorkerPlugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mark all methods here as virtual
public new async Task<TemporalConnection> TemporalConnectAsync(TemporalClientConnectOptions options) | ||
{ | ||
return await TemporalConnection.ConnectAsync(options).ConfigureAwait(false); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public new async Task<TemporalConnection> TemporalConnectAsync(TemporalClientConnectOptions options) | |
{ | |
return await TemporalConnection.ConnectAsync(options).ConfigureAwait(false); | |
} | |
public Task<TemporalConnection> TemporalConnectAsync(TemporalClientConnectOptions options) => | |
TemporalConnection.ConnectAsync(options); |
Pedantic shortcut
What was changed
Why?
Checklist
Closes
How was this tested: