Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public override void Awake(DBSaveBatchTask self, List <Component> disposers, string collectionName, TaskCompletionSource <bool> tcs)
 {
     self.Disposers      = disposers;
     self.CollectionName = collectionName;
     self.Tcs            = tcs;
 }