Open
Description
Does the BatchJobClient have a plan to support async methods?
_batchJobClient.StartNew(action =>
{
action.Enqueue<IHomeServicecs>(t => t.TestMethod());
action.Enqueue<IHomeServicecs>(t => t.TestMethod());
action.Enqueue<IHomeServicecs>(t => t.TestMethod());
action.Enqueue<IHomeServicecs>(t => t.TestMethod());
action.Enqueue<IHomeServicecs>(t => t.TestMethod());
action.Enqueue<IHomeServicecs>(t => t.TestMethod());//some job
using TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew);
_warehouseDbContext.SaveChanges();
_commonDbContext.SaveChanges();
transactionScope.Complete();
});
I want to use async callback method
_batchJobClient.StartNew(async action =>
{
action.Enqueue<IHomeServicecs>(t => t.TestMethod());
action.Enqueue<IHomeServicecs>(t => t.TestMethod());
action.Enqueue<IHomeServicecs>(t => t.TestMethod());
action.Enqueue<IHomeServicecs>(t => t.TestMethod());
action.Enqueue<IHomeServicecs>(t => t.TestMethod());
action.Enqueue<IHomeServicecs>(t => t.TestMethod());//some job
using TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew);
await _warehouseDbContext.SaveChangesAsync();
await _commonDbContext.SaveChangesAsync();
transactionScope.Complete();
});
If there is no plan, is there any way I can adapt it myself? I looked at the source code and found that it didn't seem like that much work to change this method alone
Metadata
Metadata
Assignees
Labels
No labels