Skip to content

Commit

Permalink
rollback testprovider
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeralsing committed Feb 29, 2024
1 parent 1a06e4e commit 1e9929a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Proto.Cluster.TestProvider/TestProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ public TestProvider(TestProviderOptions options, InMemAgent agent)
_agent = agent;
}

public async Task StartMemberAsync(Cluster cluster)
public Task StartMemberAsync(Cluster cluster)
{
await Task.Yield();
var memberList = cluster.MemberList;
var (host, port) = cluster.System.GetAddress();
var kinds = cluster.GetClusterKinds();
Expand All @@ -47,26 +46,30 @@ public async Task StartMemberAsync(Cluster cluster)
Port = port
}
);

return Task.CompletedTask;
}

public async Task StartClientAsync(Cluster cluster)
public Task StartClientAsync(Cluster cluster)
{
await Task.Yield();
var memberList = cluster.MemberList;

_id = cluster.System.Id;
_memberList = memberList;
_agent.StatusUpdate += AgentOnStatusUpdate;
_agent.ForceUpdate();

return Task.CompletedTask;
}

public async Task ShutdownAsync(bool graceful)
public Task ShutdownAsync(bool graceful)
{
await Task.Delay(100);
Logger.LogDebug("Unregistering service {Service}", _id);

_ttlReportTimer?.Stop();
_agent.DeregisterService(_id);

return Task.CompletedTask;
}

private void AgentOnStatusUpdate(object sender, EventArgs e) => NotifyStatuses();
Expand Down

0 comments on commit 1e9929a

Please sign in to comment.