private void WorkerCallback(object state) { try { using (Locking.GetMutex(this.Packet.FullPath).Lock()) { this.Packet.Load(); } this.Packet.DeserializeDecompress(this.queryPlan); } catch (Exception ex) { this.exception = ex; } this.TaskCompleted.Set(); }
private async Task WorkerAsync() { try { using (Locking.GetMutex(this.Packet.FullPath).Lock()) { await this.Packet.LoadAsync(); } this.Packet.DeserializeDecompress(this.queryPlan); } catch (Exception ex) { this.exception = ex; } this.TaskCompleted.Set(); }
/// <summary> /// Entry point for a worker thread /// </summary> /// <param name="packetPlan">Payload</param> private void CommitThread(PacketPlan packetPlan) { if (this.exception != null) { return; } try { var packet = new Packet <T>(this.table, packetPlan.Index, packetPlan.IndexPath); using (Locking.GetMutex(packet.FullPath).Lock()) { packet.Load(); packet.DeserializeDecompress(); this.UpdatePacketFromPlan(packetPlan, packet); packet.SerializeCompress(); packet.Save(); } } catch (Exception ex) { this.exception = ex; } }