-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make outbox truly generic, handling multiple queues * Add "MoveAsync" to SharedStorage * Refactor saving pretranslations file
- Loading branch information
1 parent
1d5e603
commit be36554
Showing
21 changed files
with
352 additions
and
240 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace SIL.Machine.AspNetCore.Models; | ||
|
||
public record Outbox : IEntity | ||
{ | ||
public string Id { get; set; } = ""; | ||
|
||
public int Revision { get; set; } | ||
|
||
public string Name { get; set; } = null!; | ||
public int CurrentIndex { get; set; } | ||
|
||
public static async Task<Outbox> GetOutboxNextIndexAsync( | ||
IRepository<Outbox> indexRepository, | ||
string outboxName, | ||
CancellationToken cancellationToken | ||
) | ||
{ | ||
Outbox outbox = ( | ||
await indexRepository.UpdateAsync( | ||
i => i.Name == outboxName, | ||
i => i.Inc(b => b.CurrentIndex, 1), | ||
upsert: true, | ||
cancellationToken: cancellationToken | ||
) | ||
)!; | ||
return outbox; | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace SIL.Machine.AspNetCore.Services; | ||
|
||
public interface IOutboxMessageHandler | ||
{ | ||
public string Name { get; } | ||
|
||
public Task SendMessageAsync(OutboxMessage message, CancellationToken cancellationToken = default); | ||
public Task CleanupMessageAsync(OutboxMessage message, CancellationToken cancellationToken = default); | ||
} |
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.