public Task <bool> AddBatch(List <Disposer> disposers, string collectionName) { TaskCompletionSource <bool> tcs = new TaskCompletionSource <bool>(); DBSaveBatchTask task = EntityFactory.Create <DBSaveBatchTask, List <Disposer>, string, TaskCompletionSource <bool> >(disposers, collectionName, tcs); this.tasks[(int)((ulong)task.Id % taskCount)].Add(task); return(tcs.Task); }
public Task <bool> AddBatch(List <Entity> entitys, string collectionName) { TaskCompletionSource <bool> tcs = new TaskCompletionSource <bool>(); DBSaveBatchTask task = new DBSaveBatchTask(entitys, collectionName, tcs); this.tasks[(int)((ulong)task.Id % taskCount)].Add(task); return(tcs.Task); }
public override void Awake(DBSaveBatchTask self, List <Component> disposers, string collectionName, TaskCompletionSource <bool> tcs) { self.Disposers = disposers; self.CollectionName = collectionName; self.Tcs = tcs; }