Example #1
0
 Task LogViewer.IMessagesSource.EnumMessages(
     long fromPosition, Func <IMessage, bool> callback, EnumMessagesFlag flags,
     LogProviderCommandPriority priority, CancellationToken cancellation)
 {
     ssr.EnumMessages(fromPosition, callback, flags);
     return(Task.FromResult(1));
 }
 Task IMessagesSource.EnumMessages(long fromPosition, Func <IMessage, bool> callback,
                                   EnumMessagesFlag flags, LogProviderCommandPriority priority, CancellationToken cancellation)
 {
     if (ls.IsDisposed)
     {
         throw new OperationCanceledException();
     }
     return(ls.Provider.EnumMessages(fromPosition, callback, flags, priority, cancellation));
 }
Example #3
0
        Task <DateBoundPositionResponseData> ILogProvider.GetDateBoundPosition(
            DateTime d, ListUtils.ValueBound bound, bool getDate,
            LogProviderCommandPriority priority, CancellationToken cancellation)
        {
            CheckDisposed();
            var ret = new GetDateBoundCommand(d, getDate, bound, dateBoundsCache);
            var cmd = new Command(Command.CommandType.GetDateBound, priority, tracer, cancellation, ret);

            PostCommand(cmd);
            return(ret.Task);
        }
Example #4
0
 public Command(
     CommandType t,
     LogProviderCommandPriority priority,
     LJTraceSource trace,
     CancellationToken cancellation,
     IAsyncLogProviderCommandHandler handler)
 {
     Type         = t;
     Priority     = priority;
     Cancellation = cancellation;
     Handler      = handler;
     Perfop       = new LogJoint.Profiling.Operation(trace, this.ToString());
 }
Example #5
0
 public Command(
     CommandType t,
     LogProviderCommandPriority priority,
     LJTraceSource trace,
     CancellationToken cancellation,
     IAsyncLogProviderCommandHandler handler)
 {
     Type         = t;
     Id           = Interlocked.Increment(ref lastCommandId);
     Priority     = priority;
     Cancellation = cancellation;
     Handler      = handler;
     Perfop       = new Profiling.Operation(trace, this.ToString());
 }
Example #6
0
        Task ILogProvider.EnumMessages(
            long startFrom,
            Func <IMessage, bool> callback,
            EnumMessagesFlag flags,
            LogProviderCommandPriority priority,
            CancellationToken cancellation
            )
        {
            CheckDisposed();
            var     ret = new EnumMessagesCommand(startFrom, flags, callback);
            Command cmd = new Command(Command.CommandType.Get, priority, tracer, cancellation, ret);

            PostCommand(cmd);
            if ((flags & EnumMessagesFlag.IsActiveLogPositionHint) != 0)
            {
                Interlocked.Exchange(ref activePositionHint, startFrom);
                PostCommand(new Command(Command.CommandType.UpdateCache, LogProviderCommandPriority.SmoothnessEnsurance, tracer,
                                        cancellation, new UpdateCacheCommandHandler(this, tracer, messagesCacheBackbuffer, host.GlobalSettings)));
            }
            return(ret.Task);
        }
Example #7
0
 Task <DateBoundPositionResponseData> IMessagesSource.GetDateBoundPosition(DateTime d, ListUtils.ValueBound bound, LogProviderCommandPriority priority, System.Threading.CancellationToken cancellation)
 {
     return(Task.FromResult(messages.GetDateBoundPosition(d, bound)));
 }
Example #8
0
 Task <DateBoundPositionResponseData> LogViewer.IMessagesSource.GetDateBoundPosition(
     DateTime d, ValueBound bound,
     LogProviderCommandPriority priority, CancellationToken cancellation)
 {
     return(Task.FromResult(ssr.GetDateBoundPosition(d, bound)));
 }
Example #9
0
 Task IMessagesSource.EnumMessages(long fromPosition, Func <IMessage, bool> callback,
                                   EnumMessagesFlag flags, LogProviderCommandPriority priority, CancellationToken cancellation)
 {
     return(ls.Provider.EnumMessages(fromPosition, callback, flags, priority, cancellation));
 }
Example #10
0
 Task <DateBoundPositionResponseData> IMessagesSource.GetDateBoundPosition(DateTime d, ListUtils.ValueBound bound,
                                                                           LogProviderCommandPriority priority, CancellationToken cancellation)
 {
     return(ls.Provider.GetDateBoundPosition(d, bound, false, priority, cancellation));
 }
 Task <DateBoundPositionResponseData> IMessagesSource.GetDateBoundPosition(DateTime d, ValueBound bound,
                                                                           LogProviderCommandPriority priority, CancellationToken cancellation)
 {
     if (ls.IsDisposed)
     {
         throw new OperationCanceledException();
     }
     return(ls.Provider.GetDateBoundPosition(d, bound, false, priority, cancellation));
 }