Skip to content

Commit

Permalink
Remove unnecessary changes as start and resolve etc are already calle…
Browse files Browse the repository at this point in the history
…d from sync context.
  • Loading branch information
kannanjgithub committed Nov 5, 2024
1 parent 75719be commit d882a00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -878,14 +878,13 @@ public String getServiceAuthority() {

@Override
public void start(Listener2 listener) {
args.getSynchronizationContext().execute(() ->
listener.onResult2(
ResolutionResult.newBuilder()
.setAddressesOrError(
StatusOr.fromValue(
Collections.singletonList(new EquivalentAddressGroup(address))))
.setAttributes(Attributes.EMPTY)
.build()));
listener.onResult2(
ResolutionResult.newBuilder()
.setAddressesOrError(
StatusOr.fromValue(
Collections.singletonList(new EquivalentAddressGroup(address))))
.setAttributes(Attributes.EMPTY)
.build());
}

@Override
Expand Down
5 changes: 1 addition & 4 deletions netty/src/main/java/io/grpc/netty/UdsNameResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@
final class UdsNameResolver extends NameResolver {
private NameResolver.Listener2 listener;
private final String authority;
private final Args args;

UdsNameResolver(String authority, String targetPath, Args args) {
checkArgument(authority == null, "non-null authority not supported");
this.authority = targetPath;
this.args = args;
}

@Override
Expand All @@ -60,8 +58,7 @@ private void resolve() {
List<EquivalentAddressGroup> servers = new ArrayList<>(1);
servers.add(new EquivalentAddressGroup(new DomainSocketAddress(authority)));
resolutionResultBuilder.setAddressesOrError(StatusOr.fromValue(servers));
args.getSynchronizationContext().execute(() ->
listener.onResult2(resolutionResultBuilder.build()));
listener.onResult2(resolutionResultBuilder.build());
}

@Override
Expand Down

0 comments on commit d882a00

Please sign in to comment.