コード例 #1
0
        internal override void Enter <TKey>(Process process, TKey localkey, Stopwatch stopwatch, out bool isExiting)
        {
            var completed = Execute <TKey>(process, localkey, out var result);

            if (!completed)
            {           // we did not actually execute, but are waiting for initialization ack
                isExiting = false;
                return; // keep lock
            }

            if (MessageType != MessageType.ForkUpdate)
            {
                process.Send(process.GetOrigin(Opid), new RespondToLocal()
                {
                    Opid = Opid, Parent = Parent, Result = result
                });
            }
            else
            {
                process.CheckForUnhandledException(result);
            }

            process.Telemetry?.OnApplicationEvent(
                processId: process.ProcessId,
                id: Opid.ToString(),
                name: LabelForTelemetry,
                parent: Parent.ToString(),
                opSide: OperationSide.Callee,
                opType: OperationType.Local,
                duration: stopwatch.Elapsed.TotalMilliseconds
                );

            isExiting = true;
        }
コード例 #2
0
        private void TryCommit <TKey>(Process process, Stopwatch stopwatch, out bool isExiting)
        {
            if (PendingAcks > 0)
            {
                isExiting = false;
                return;
            }

            ApplyEffects <TKey>(process);

            process.Telemetry?.OnApplicationEvent(
                processId: process.ProcessId,
                id: Opid.ToString(),
                name: LabelForTelemetry.ToString(),
                parent: Parent.ToString(),
                opSide: OperationSide.Callee,
                opType: OperationType.Event,
                duration: stopwatch.Elapsed.TotalMilliseconds
                );

            isExiting = true;
        }