-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for alternate client (#193)
* Add support for alternate client * Refactor test case * Fix replacement logic in case other parts of url contain "api"
- Loading branch information
Showing
20 changed files
with
236 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
using ConductorSharp.Client.Generated; | ||
using System.Net.Http; | ||
using ConductorSharp.Client.Generated; | ||
|
||
namespace ConductorSharp.Client.Service | ||
{ | ||
public class ExternalPayloadService(ConductorClient client) : IExternalPayloadService | ||
public class ExternalPayloadService(IHttpClientFactory httpClientFactory, string clientName) : IExternalPayloadService | ||
{ | ||
private readonly ConductorClient _client = new(httpClientFactory.CreateClient(clientName)); | ||
|
||
public async Task<FileResponse> GetExternalStorageDataAsync(string externalPayloadPath, CancellationToken cancellationToken = default) => | ||
await client.GetExternalStorageDataAsync(externalPayloadPath, cancellationToken); | ||
await _client.GetExternalStorageDataAsync(externalPayloadPath, cancellationToken); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
using ConductorSharp.Client.Generated; | ||
using System.Net.Http; | ||
using ConductorSharp.Client.Generated; | ||
|
||
namespace ConductorSharp.Client.Service | ||
{ | ||
public class HealthService(ConductorClient client) : IHealthService | ||
public class HealthService(IHttpClientFactory httpClientFactory, string clientName) : IHealthService | ||
{ | ||
private readonly ConductorClient _conductorClient = client; | ||
private readonly ConductorClient _client = new(httpClientFactory.CreateClient(clientName)); | ||
|
||
public async Task<HealthCheckStatus> CheckHealthAsync(CancellationToken cancellationToken = default) => | ||
await _conductorClient.DoCheckAsync(cancellationToken); | ||
await _client.DoCheckAsync(cancellationToken); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
using ConductorSharp.Client.Generated; | ||
using System.Net.Http; | ||
using ConductorSharp.Client.Generated; | ||
|
||
namespace ConductorSharp.Client.Service; | ||
|
||
public class QueueAdminService(ConductorClient client) : IQueueAdminService | ||
public class QueueAdminService(IHttpClientFactory httpClientFactory, string clientName) : IQueueAdminService | ||
{ | ||
private readonly ConductorClient _client = new(httpClientFactory.CreateClient(clientName)); | ||
|
||
public async Task MarkWaitTaskCompletedAsync( | ||
string workflowId, | ||
string taskRefName, | ||
Status2 status, | ||
IDictionary<string, object> output, | ||
CancellationToken cancellationToken = default | ||
) => await client.Update_1Async(workflowId, taskRefName, status, output, cancellationToken); | ||
) => await _client.Update_1Async(workflowId, taskRefName, status, output, cancellationToken); | ||
|
||
public async Task MarkWaitTaskCompletedAsync( | ||
string workflowId, | ||
string taskId, | ||
Generated.TaskStatus status, | ||
IDictionary<string, object> output, | ||
CancellationToken cancellationToken = default | ||
) => await client.UpdateByTaskIdAsync(workflowId, taskId, status, output, cancellationToken); | ||
) => await _client.UpdateByTaskIdAsync(workflowId, taskId, status, output, cancellationToken); | ||
|
||
public async Task<IDictionary<string, long>> GetQueueLengthAsync(CancellationToken cancellationToken = default) => | ||
await client.Size_1Async(cancellationToken); | ||
await _client.Size_1Async(cancellationToken); | ||
|
||
public async Task<IDictionary<string, string>> GetQueueNamesAsync(CancellationToken cancellationToken = default) => | ||
await client.NamesAsync(cancellationToken); | ||
await _client.NamesAsync(cancellationToken); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.