예제 #1
0
        public Task <bool> Add(ComponentWithId component, string collectionName = "")
        {
            TaskCompletionSource <bool> tcs = new TaskCompletionSource <bool>();

            if (string.IsNullOrEmpty(collectionName))
            {
                collectionName = component.GetType().Name;
            }
            DBSaveTask task = ComponentFactory.CreateWithId <DBSaveTask, ComponentWithId, string, TaskCompletionSource <bool> >(component.Id, component, collectionName, tcs);

            this.tasks[(int)((ulong)task.Id % taskCount)].Add(task);

            return(tcs.Task);
        }
예제 #2
0
 public override void Awake(DBSaveTask self, Component entity, string collectionName, TaskCompletionSource <bool> tcs)
 {
     self.Disposer       = entity;
     self.CollectionName = collectionName;
     self.Tcs            = tcs;
 }
예제 #3
0
 public override void Awake(DBSaveTask self, ComponentWithId component, string collectionName, ETTaskCompletionSource <bool> tcs)
 {
     self.Component      = component;
     self.CollectionName = collectionName;
     self.Tcs            = tcs;
 }