public static Invocation ToModel(this InvocationState self, UrlHelper url) { return(new Invocation() { Id = self.Id, Job = self.Job, JobInstanceName = self.JobInstanceName, Source = self.Source, Payload = self.Payload, Status = self.Status, Result = self.Result, ResultMessage = self.ResultMessage, LastUpdatedBy = self.LastUpdatedBy, LogUrl = url == null ? self.LogUrl : url.RouteUri(Routes.GetInvocationLog, new { id = self.Id.ToString("N").ToLowerInvariant() }).AbsoluteUri, DequeueCount = self.DequeueCount, IsContinuation = self.IsContinuation, LastDequeuedAt = self.LastDequeuedAt, LastSuspendedAt = self.LastSuspendedAt, CompletedAt = self.CompletedAt, QueuedAt = self.QueuedAt, NextVisibleAt = self.NextVisibleAt, UpdatedAt = self.UpdatedAt }); }
internal void CallFromNativeContract(Action onComplete, UInt160 hash, string method, params StackItem[] args) { InvocationState state = GetInvocationState(CurrentContext); state.ReturnType = typeof(void); state.Callback = onComplete; CallContractInternal(hash, method, new VMArray(ReferenceCounter, args), CallFlags.All, ReturnTypeConvention.EnsureIsEmpty); }
internal void CallFromNativeContract <T>(Action <T> onComplete, UInt160 hash, string method, params StackItem[] args) { InvocationState state = GetInvocationState(CurrentContext); state.ReturnType = typeof(T); state.Callback = onComplete; CallContract(hash, method, new VMArray(ReferenceCounter, args)); }
public BlobInvocationLogCapture(InvocationState invocation, CloudBlobContainer logContainer) : base(invocation) { LogContainer = logContainer; _tempDirectory = Path.Combine(Path.GetTempPath(), "InvocationLogs"); _blobName = invocation.Id.ToString("N") + ".json"; }
private InvocationState GetInvocationState(ExecutionContext context) { if (!invocationStates.TryGetValue(context, out InvocationState state)) { state = new InvocationState(); invocationStates.Add(context, state); } return(state); }
public InvocationLogCapture(InvocationState invocation) { Invocation = invocation; // Set up an event stream _listener = new ObservableEventListener(); _eventStream = from events in _listener where InvocationContext.GetCurrentInvocationId() == Invocation.Id select events; }
protected internal override Task Dispatch(InvocationState invocation, InvocationLogCapture capture, CancellationToken cancelToken) { LastDispatched = invocation; if (_skipDispatch) { return(DispatchTCS.Task); } else { return(base.Dispatch(invocation, capture, cancelToken)); } }
protected internal override Task Dispatch(InvocationState invocation, InvocationLogCapture capture, CancellationToken cancelToken) { LastDispatched = invocation; if (_skipDispatch) { return DispatchTCS.Task; } else { return base.Dispatch(invocation, capture, cancelToken); } }
protected internal override Task Dispatch(InvocationState invocation, CancellationToken cancelToken) { return Dispatch(invocation, new InvocationLogCapture(invocation), cancelToken); }
public void Aborted(InvocationState invocation) { Aborted(invocation.Id); }
protected internal override Task Dispatch(InvocationState invocation, CancellationToken cancelToken) { return(Dispatch(invocation, new InvocationLogCapture(invocation), cancelToken)); }
public void Cancelled(InvocationState invocation) { Cancelled(invocation.Id, invocation.Job, invocation.UpdatedAt.ToString("O"), invocation.ResultMessage); }
public void InvocationTookTooLong(InvocationState invocation) { InvocationTookTooLong(invocation.Id, invocation.Job, invocation.QueuedAt.ToString("O"), invocation.NextVisibleAt.ToString("O")); }
public void ScheduledRepeat(InvocationState original, InvocationState repeat, TimeSpan period) { ScheduledRepeat(original.Id, repeat.Id, repeat.Job, period.ToString()); }
public static Invocation ToModel(this InvocationState self) { return(ToModel(self, null)); }