bool PersistItemAdd(Ptr ptr, IQueueItem item) { Task tsk = Task.Factory.StartNew(() => m_db.TryAdd(ptr.Identifier, item) ); return(true); }
protected override bool TryAdd(Ptr ptr, IQueueItem item) { var copy = item.Copy(); QueueList[ptr] = copy; if (CoverMode == CoverMode.Persistent) { if (CommitMode == CommitMode.OnDisk) { if (m_db.TryAdd(ptr.Identifier, copy)) { OnTryAdd(ptr, item, true); return(true); } } else //if (CommitMode == CommitMode.OnMemory) { return(PersistItemAdd(ptr, copy)); } return(false); } else //if (CommitMode == CommitMode.OnMemory) { return(true); } }
protected override bool TryAdd(Ptr ptr, IQueueItem item) { var res = m_db.TryAdd(ptr.Identifier, item.Copy()); OnTryAdd(ptr, item, res); return(res); }