Example #1
0
            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();
            }
Example #2
0
            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();
            }
Example #3
0
        /// <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;
            }
        }