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); }
public override void Awake(DBSaveTask self, Component entity, string collectionName, TaskCompletionSource <bool> tcs) { self.Disposer = entity; self.CollectionName = collectionName; self.Tcs = tcs; }
public override void Awake(DBSaveTask self, ComponentWithId component, string collectionName, ETTaskCompletionSource <bool> tcs) { self.Component = component; self.CollectionName = collectionName; self.Tcs = tcs; }