NightOwl888 commented on code in PR #1182:
URL: https://github.com/apache/lucenenet/pull/1182#discussion_r2338622939
##########
src/Lucene.Net.Replicator/ReplicationClient.cs:
##########
@@ -151,6 +155,20 @@ public ReplicationClient(IReplicator replicator,
IReplicationHandler handler, IS
this.factory = factory;
}
+ /// <summary>
+ /// Constructor for async replicators.
+ /// </summary>
+ /// <param name="asyncReplicator"></param>
+ /// <param name="handler"></param>
+ /// <param name="factory"></param>
+ /// <exception cref="ArgumentNullException"></exception>
+ public ReplicationClient(IAsyncReplicator asyncReplicator,
IReplicationHandler handler, ISourceDirectoryFactory factory)
Review Comment:
> Mark sync APIs with [Obsolete("Prefer async methods to avoid deadlocks.")]
to gently guide users toward async.
Long term: async becomes the default; sync kept only for backward
compatibility.
No, synchronous programming isn't going away any time soon. It is just in
the space of HTTP servers, that it is no longer considered a good practice.
Also, keep in mind that when debugging we will be comparing our implementation
against the synchronous Java code. So, we should try to minimize changes to
these methods.
---------------
`ReplicationClient` is not sealed. It is designed to be inherited to provide
additional functionality. So, in that regard, it is the abstraction and can
provide the base implementation of both the synchronous and asynchronous sides.
The question is since `ReplicationClient` can already be mocked by inheritance,
do we need to add interfaces?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]