当前位置: 首页>>代码示例>>C#>>正文


C# IPublisher类代码示例

本文整理汇总了C#中IPublisher的典型用法代码示例。如果您正苦于以下问题:C# IPublisher类的具体用法?C# IPublisher怎么用?C# IPublisher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IPublisher类属于命名空间,在下文中一共展示了IPublisher类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SubscriberCreator

 public SubscriberCreator(IPublisher publisher)
 {
     if (publisher==null)
     {
         throw new NullReferenceException("Publisher should not be null");
     }
 }
开发者ID:itwymt,项目名称:Kata5-ninject,代码行数:7,代码来源:SubscriberCreator.cs

示例2: CoreProjectionCheckpointManager

        protected CoreProjectionCheckpointManager(
            IPublisher publisher, Guid projectionCorrelationId, ProjectionConfig projectionConfig, string name,
            PositionTagger positionTagger, ProjectionNamesBuilder namingBuilder, bool usePersistentCheckpoints,
            bool producesRunningResults)
        {
            if (publisher == null) throw new ArgumentNullException("publisher");
            if (projectionConfig == null) throw new ArgumentNullException("projectionConfig");
            if (name == null) throw new ArgumentNullException("name");
            if (positionTagger == null) throw new ArgumentNullException("positionTagger");
            if (namingBuilder == null) throw new ArgumentNullException("namingBuilder");
            if (name == "") throw new ArgumentException("name");

            _lastProcessedEventPosition = new PositionTracker(positionTagger);
            _zeroTag = positionTagger.MakeZeroCheckpointTag();

            _publisher = publisher;
            _projectionCorrelationId = projectionCorrelationId;
            _projectionConfig = projectionConfig;
            _logger = LogManager.GetLoggerFor<CoreProjectionCheckpointManager>();
            _namingBuilder = namingBuilder;
            _usePersistentCheckpoints = usePersistentCheckpoints;
            _producesRunningResults = producesRunningResults;
            _requestedCheckpointState = new PartitionState("", null, _zeroTag);
            _currentProjectionState = new PartitionState("", null, _zeroTag);
        }
开发者ID:thinkbeforecoding,项目名称:EventStore,代码行数:25,代码来源:CoreProjectionCheckpointManager.cs

示例3: CoreProjectionCheckpointManager

 protected CoreProjectionCheckpointManager(
     ICoreProjection coreProjection, IPublisher publisher, Guid projectionCorrelationId,
     RequestResponseDispatcher
         <ClientMessage.ReadStreamEventsBackward, ClientMessage.ReadStreamEventsBackwardCompleted> readDispatcher,
     RequestResponseDispatcher<ClientMessage.WriteEvents, ClientMessage.WriteEventsCompleted> writeDispatcher,
     ProjectionConfig projectionConfig, string name,
     PositionTagger positionTagger)
 {
     if (coreProjection == null) throw new ArgumentNullException("coreProjection");
     if (publisher == null) throw new ArgumentNullException("publisher");
     if (readDispatcher == null) throw new ArgumentNullException("readDispatcher");
     if (writeDispatcher == null) throw new ArgumentNullException("writeDispatcher");
     if (projectionConfig == null) throw new ArgumentNullException("projectionConfig");
     if (name == null) throw new ArgumentNullException("name");
     if (positionTagger == null) throw new ArgumentNullException("positionTagger");
     if (name == "") throw new ArgumentException("name");
     _lastProcessedEventPosition = new PositionTracker(positionTagger);
     _coreProjection = coreProjection;
     _publisher = publisher;
     _projectionCorrelationId = projectionCorrelationId;
     _readDispatcher = readDispatcher;
     _writeDispatcher = writeDispatcher;
     _projectionConfig = projectionConfig;
     _logger = LogManager.GetLoggerFor<CoreProjectionCheckpointManager>();
     _name = name;
     _positionTagger = positionTagger;
 }
开发者ID:robashton,项目名称:EventStore,代码行数:27,代码来源:CoreProjectionCheckpointManager.cs

示例4: CreatePausedEventDistributionPoint

 public EventDistributionPoint CreatePausedEventDistributionPoint(Guid distributionPointId, IPublisher publisher, CheckpointTag checkpointTag)
 {
     if (_allStreams)
     {
         var distributionPoint = new TransactionFileReaderEventDistributionPoint(
             publisher, distributionPointId,
             new EventPosition(checkpointTag.CommitPosition.Value, checkpointTag.PreparePosition.Value));
         return distributionPoint;
     }
     else if (_streams != null && _streams.Count == 1)
     {
         var streamName = checkpointTag.Streams.Keys.First();
         //TODO: handle if not the same
         return CreatePausedStreamReaderEventDistributionPoint(distributionPointId, publisher, checkpointTag, streamName,
             resolveLinkTos: true, category: null);
     }
     else if (_categories != null && _categories.Count == 1)
     {
         var streamName = checkpointTag.Streams.Keys.First();
         return CreatePausedStreamReaderEventDistributionPoint(distributionPointId, publisher, checkpointTag, streamName,
             resolveLinkTos: true, category: _categories.First());
     }
     else
         throw new NotSupportedException();
 }
开发者ID:jpierson,项目名称:EventStore,代码行数:25,代码来源:CheckpointStrategy.cs

示例5: ProjectsController

 public ProjectsController(IProjectsService projects, IUsersService users, IImagesService images, IPublisher publisher)
 {
     this.projects = projects;
     this.users = users;
     this.images = images;
     this.publisher = publisher;
 }
开发者ID:Telerik-Team-Ares,项目名称:Startkicker,代码行数:7,代码来源:ProjectsController.cs

示例6: EventStoreEmbeddedNodeConnection

        public EventStoreEmbeddedNodeConnection(ConnectionSettings settings, string connectionName, IPublisher publisher, ISubscriber bus, IAuthenticationProvider authenticationProvider)
        {
            Ensure.NotNull(publisher, "publisher");
            Ensure.NotNull(settings, "settings");

            Guid connectionId = Guid.NewGuid();

            _settings = settings;
            _connectionName = connectionName;
            _publisher = publisher;
            _authenticationProvider = authenticationProvider;
            _subscriptionBus = new InMemoryBus("Embedded Client Subscriptions");
            _subscriptions = new EmbeddedSubscriber(_subscriptionBus, _authenticationProvider, _settings.Log, connectionId);
            
            _subscriptionBus.Subscribe<ClientMessage.SubscriptionConfirmation>(_subscriptions);
            _subscriptionBus.Subscribe<ClientMessage.SubscriptionDropped>(_subscriptions);
            _subscriptionBus.Subscribe<ClientMessage.StreamEventAppeared>(_subscriptions);
            _subscriptionBus.Subscribe<ClientMessage.PersistentSubscriptionConfirmation>(_subscriptions);
            _subscriptionBus.Subscribe<ClientMessage.PersistentSubscriptionStreamEventAppeared>(_subscriptions);
            _subscriptionBus.Subscribe(new AdHocHandler<ClientMessage.SubscribeToStream>(_publisher.Publish));
            _subscriptionBus.Subscribe(new AdHocHandler<ClientMessage.UnsubscribeFromStream>(_publisher.Publish));
            _subscriptionBus.Subscribe(new AdHocHandler<ClientMessage.ConnectToPersistentSubscription>(_publisher.Publish));

            bus.Subscribe(new AdHocHandler<SystemMessage.BecomeShutdown>(_ => Disconnected(this, new ClientConnectionEventArgs(this, new IPEndPoint(IPAddress.None, 0)))));
        }
开发者ID:danieldeb,项目名称:EventStore,代码行数:25,代码来源:EventStoreEmbeddedNodeConnection.cs

示例7: ReadIndex

        public ReadIndex(IPublisher bus,
                         int readerCount,
                         Func<ITransactionFileSequentialReader> seqReaderFactory,
                         Func<ITransactionFileReader> readerFactory,
                         ITableIndex tableIndex,
                         IHasher hasher,
                         ILRUCache<string, StreamCacheInfo> streamInfoCache)
        {
            Ensure.NotNull(bus, "bus");
            Ensure.Positive(readerCount, "readerCount");
            Ensure.NotNull(seqReaderFactory, "seqReaderFactory");
            Ensure.NotNull(readerFactory, "readerFactory");
            Ensure.NotNull(tableIndex, "tableIndex");
            Ensure.NotNull(hasher, "hasher");
            Ensure.NotNull(streamInfoCache, "streamInfoCache");

            _bus = bus;
            _tableIndex = tableIndex;
            _hasher = hasher;
            _streamInfoCache = streamInfoCache;

            for (int i = 0; i < readerCount; ++i)
            {
                _seqReaders.Push(seqReaderFactory());
                _readers.Push(readerFactory());
            }
        }
开发者ID:base31,项目名称:geteventstore_EventStore,代码行数:27,代码来源:ReadIndex.cs

示例8: BuildAuthenticationProvider

		public IAuthenticationProvider BuildAuthenticationProvider(IPublisher mainQueue, IBus mainBus, IPublisher workersQueue, InMemoryBus[] workerBusses)
		{
			var passwordHashAlgorithm = new Rfc2898PasswordHashAlgorithm();
			var dispatcher = new IODispatcher(mainQueue, new PublishEnvelope(workersQueue, crossThread: true));
			
			foreach (var bus in workerBusses) {
				bus.Subscribe(dispatcher.ForwardReader);
				bus.Subscribe(dispatcher.BackwardReader);
				bus.Subscribe(dispatcher.Writer);
				bus.Subscribe(dispatcher.StreamDeleter);
				bus.Subscribe(dispatcher);
			}

			// USER MANAGEMENT
			var ioDispatcher = new IODispatcher(mainQueue, new PublishEnvelope(mainQueue));
			mainBus.Subscribe(ioDispatcher.BackwardReader);
			mainBus.Subscribe(ioDispatcher.ForwardReader);
			mainBus.Subscribe(ioDispatcher.Writer);
			mainBus.Subscribe(ioDispatcher.StreamDeleter);
			mainBus.Subscribe(ioDispatcher);

			var userManagement = new UserManagementService(mainQueue, ioDispatcher, passwordHashAlgorithm, skipInitializeStandardUsersCheck: false);
			mainBus.Subscribe<UserManagementMessage.Create>(userManagement);
			mainBus.Subscribe<UserManagementMessage.Update>(userManagement);
			mainBus.Subscribe<UserManagementMessage.Enable>(userManagement);
			mainBus.Subscribe<UserManagementMessage.Disable>(userManagement);
			mainBus.Subscribe<UserManagementMessage.Delete>(userManagement);
			mainBus.Subscribe<UserManagementMessage.ResetPassword>(userManagement);
			mainBus.Subscribe<UserManagementMessage.ChangePassword>(userManagement);
			mainBus.Subscribe<UserManagementMessage.Get>(userManagement);
			mainBus.Subscribe<UserManagementMessage.GetAll>(userManagement);
			mainBus.Subscribe<SystemMessage.BecomeMaster>(userManagement);
			
			return new InternalAuthenticationProvider(dispatcher, passwordHashAlgorithm, ESConsts.CachedPrincipalCount);
		}
开发者ID:thinkbeforecoding,项目名称:EventStore,代码行数:35,代码来源:InternalAuthenticationProviderFactory.cs

示例9: CreateProcessingPhases

        public override sealed IProjectionProcessingPhase[] CreateProcessingPhases(
            IPublisher publisher, Guid projectionCorrelationId, PartitionStateCache partitionStateCache,
            Action updateStatistics, CoreProjection coreProjection, ProjectionNamesBuilder namingBuilder,
            ITimeProvider timeProvider, IODispatcher ioDispatcher,
            CoreProjectionCheckpointWriter coreProjectionCheckpointWriter)
        {
            var definesFold = _sourceDefinition.DefinesFold;

            var readerStrategy = CreateReaderStrategy(timeProvider);

            var zeroCheckpointTag = readerStrategy.PositionTagger.MakeZeroCheckpointTag();

            var checkpointManager = CreateCheckpointManager(
                projectionCorrelationId, publisher, ioDispatcher, namingBuilder, coreProjectionCheckpointWriter,
                definesFold, readerStrategy);


            var resultWriter = CreateFirstPhaseResultWriter(
                checkpointManager as IEmittedEventWriter, zeroCheckpointTag, namingBuilder);

            var firstPhase = CreateFirstProcessingPhase(
                publisher, projectionCorrelationId, partitionStateCache, updateStatistics, coreProjection,
                _subscriptionDispatcher, zeroCheckpointTag, checkpointManager, readerStrategy, resultWriter);

            return CreateProjectionProcessingPhases(
                publisher, projectionCorrelationId, namingBuilder, partitionStateCache, coreProjection, ioDispatcher,
                firstPhase);
        }
开发者ID:jjoergensen,项目名称:EventStore,代码行数:28,代码来源:DefaultProjectionProcessingStrategy.cs

示例10: ApiModule

		public ApiModule(ICompositeApp compositeApp, ICommandRegistry registry, IPublisher publisher)
			: base(BaseRoute)
		{
			_compositeApp = compositeApp;
			_registry = registry;
			_publisher = publisher;

			Get[string.Empty] = _ => GetComposite();

			Get[AgentMetadataRoute] = p => GetAgent(stripExtension((string)p.agentSystemName));

			Get[ReadModelMetadataRoute] = p => GetReadModel((string)p.agentSystemName, stripExtension((string)p.readModelName));

			Get[InputModelMetadataRoute] = p => GetInputModel(stripExtension((string)p.inputModelName));

			Get[PublicationRecordRoute] = p => GetPublicationRecord((Guid)p.identifier);

			Get[InputModelMetadataForCommandRoute] = p => GetInputModelMetadata(stripExtension((string)p.commandName));

			Get[CommandMetadataRoute] = p => GetCommandMetadata(stripExtension((string)p.commandName));

			Get[QueryMetadataRoute] = p => GetQueryMetadata(stripExtension((string)p.queryName));

			Get[CommandIsSupportedRoute] = p => GetCommandIsSupported(stripExtension((string)p.commandName));

			Get[QueryForReadModelRoute] = p => QueryForReadmodel((string)p.queryName, (string)p.methodName);

			Get[QueryMethodRoute] = p => GetQueryMethod((string) p.queryName, (string) p.methodName);

			Post[PublishCommandRoute] = p => PublishCommand(this.Bind<IInputModel>());
		}
开发者ID:smhinsey,项目名称:Euclid,代码行数:31,代码来源:ApiModule.cs

示例11: Subscriber

        public Subscriber(IPublisher publisher, TextWriter textWriter)
        {
            _textWriter = textWriter;

            if (publisher != null)
                publisher.WriteEvent += HandleWriteEvent;
        }
开发者ID:itwymt,项目名称:Kata5-ninject,代码行数:7,代码来源:Class1.cs

示例12: MainWindow

        public MainWindow(ISubscriber<PlayerCommand> commandChannel, IPublisher<RichYouTubeClip> finishedChannel)
        {
            InitializeComponent();
            this.finishedChannel = finishedChannel;

            finishedTimer = new Timer(TimerExpired);

            progressTimer = new System.Timers.Timer(1000);
            progressTimer.AutoReset = true;
            progressTimer.Elapsed += new System.Timers.ElapsedEventHandler(progressTimer_Elapsed);

            var fiber     = new DispatcherFiber(Dispatcher);
            commandChannel.Subscribe(fiber, OnPlayerCommand);
            fiber.Start();

            WindowStyle = WindowStyle.None;
            WindowState = WindowState.Maximized;
            ShowInTaskbar = false;

            Cursor = Cursors.None;
            try
            {
                tv.Initialize();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error initialize remote control", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
开发者ID:rix0rrr,项目名称:SiouxTube,代码行数:29,代码来源:MainWindow.xaml.cs

示例13: SlaveResultWriter

        public SlaveResultWriter(IPublisher resultsPublisher, Guid masterCoreProjectionId)
        {
            if (resultsPublisher == null) throw new ArgumentNullException("resultsPublisher");

            _resultsPublisher = resultsPublisher;
            _masterCoreProjectionId = masterCoreProjectionId;
        }
开发者ID:thinkbeforecoding,项目名称:EventStore,代码行数:7,代码来源:SlaveResultWriter.cs

示例14: DispatchCommit

 public static void DispatchCommit(IPublisher bus, ICommit commit)
 {
     foreach (var @event in commit.Events)
     {
         bus.Publish(@event.Body);
     }
 }
开发者ID:NForza,项目名称:NEventStoreExample,代码行数:7,代码来源:DelegateDispatcher.cs

示例15: Bin4Net

 public static void Bin4Net(IPublisher publisher)
 {
     publisher
     .SetupMetadata(m => m
                       .FromAssemblyAttributes()
                       .AssociateWithTags("tool", "acme"));
 }
开发者ID:flq,项目名称:Bin4Net,代码行数:7,代码来源:EntryPoint2.cs


注:本文中的IPublisher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。