コード例 #1
0
ファイル: TailListenerThread.cs プロジェクト: kmcginnes/tail
 public TailListenerThread(int id, ITailCallback callback, ITailStreamListener listener, ITailStreamContext context)
 {
     _id                  = id;
     _callback            = callback;
     _listener            = listener;
     _context             = context;
     _stopSignal          = new ManualResetEvent(false);
     _stoppedSignal       = new ManualResetEvent(false);
     _thread              = new Thread(Execute);
     _thread.IsBackground = true;
 }
コード例 #2
0
 public TailListenerThread(int id, ITailCallback callback, ITailStreamListener listener, ITailStreamContext context)
 {
     _id = id;
     _callback = callback;
     _listener = listener;
     _context = context;
     _stopSignal = new ManualResetEvent(false);
     _stoppedSignal = new ManualResetEvent(false);
     _thread = new Thread(Execute);
     _thread.IsBackground = true;
 }
コード例 #3
0
        public StartListeningEvent(ITailStreamListener listener, ITailStreamContext context)
        {
            if (listener == null)
            {
                throw new ArgumentNullException("listener");
            }
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            _listener = listener;
            _context = context;
        }
コード例 #4
0
        public StartListeningEvent(ITailStreamListener listener, ITailStreamContext context)
        {
            if (listener == null)
            {
                throw new ArgumentNullException("listener");
            }
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            _listener = listener;
            _context  = context;
        }
コード例 #5
0
        public void Start(ITailStreamListener streamListener, ITailStreamContext streamContext)
        {
            lock (_lock)
            {
                // Create the thread.
                var id = Interlocked.Increment(ref _counter);

                // Notify about a new thread.
                _eventAggregator.Publish(new StartedListeningEvent(id, streamContext.GetDescription(), streamContext.GetName()));

                // Initialize the listener.
                streamListener.Initialize(streamContext);

                // Create the thread.
                var callback = new TailListenerThreadCallback(id, Publish);
                var thread   = new TailListenerThread(id, callback, streamListener, streamContext);
                thread.Start();

                _logger.Information("Created thread with id #{0} ({1}).", id, streamContext.GetDescription());

                // Add the thread to the collection.
                _threads.Add(thread);
            }
        }
コード例 #6
0
        public void Start(ITailStreamListener streamListener, ITailStreamContext streamContext)
        {
            lock (_lock)
            {
                // Create the thread.
                var id = Interlocked.Increment(ref _counter);

                // Notify about a new thread.
                _eventAggregator.Publish(new StartedListeningEvent(id, streamContext.GetDescription(), streamContext.GetName()));

                // Initialize the listener.
                streamListener.Initialize(streamContext);

                // Create the thread.
                var callback = new TailListenerThreadCallback(id, Publish);
                var thread = new TailListenerThread(id, callback, streamListener, streamContext);
                thread.Start();

                _logger.Information("Created thread with id #{0} ({1}).", id, streamContext.GetDescription());

                // Add the thread to the collection.
                _threads.Add(thread);
            }
        }
コード例 #7
0
 void ITailStreamListener.Initialize(ITailStreamContext context)
 {
     Initialize((TContext)context);
 }
コード例 #8
0
 void ITailStreamListener.Listen(ITailStreamContext context, ITailCallback callback, WaitHandle abortSignal)
 {
     Listen((TContext)context, callback, abortSignal);
 }
コード例 #9
0
ファイル: FakeProviderService.cs プロジェクト: kmcginnes/tail
 public void RegisterContext(Type type, ITailStreamContext streamContext)
 {
     _contextFactories.Add(type, streamContext);
 }
コード例 #10
0
 public void RegisterContext(Type type, ITailStreamContext streamContext)
 {
     _contextFactories.Add(type, streamContext);
 }
コード例 #11
0
ファイル: FakeProvider.cs プロジェクト: kmcginnes/tail
 public void Initialize(ITailStreamContext context)
 {
 }
コード例 #12
0
ファイル: FakeProvider.cs プロジェクト: kmcginnes/tail
 public void Listen(ITailStreamContext context, ITailCallback callback, System.Threading.WaitHandle abortSignal)
 {
 }
コード例 #13
0
ファイル: FakeProvider.cs プロジェクト: patriksvensson/tail
 public void Listen(ITailStreamContext context, ITailCallback callback, System.Threading.WaitHandle abortSignal)
 {
 }
コード例 #14
0
ファイル: FakeProvider.cs プロジェクト: patriksvensson/tail
 public void Initialize(ITailStreamContext context)
 {
 }