コード例 #1
0
        /// <inheritdoc />
        /// <summary>
        /// Creates an initializes a <see cref="T:Platibus.ISubscriptionTrackingService" />
        /// based on the provided <paramref name="configuration" />.
        /// </summary>
        /// <param name="configuration">The journaling configuration
        ///     element.</param>
        /// <returns>Returns a task whose result is an initialized
        /// <see cref="T:Platibus.ISubscriptionTrackingService" />.</returns>
        public Task <ISubscriptionTrackingService> CreateSubscriptionTrackingService(IConfiguration configuration)
        {
            var path = configuration?["path"];
            var fsTrackingBaseDir = GetRootedDirectory(path);
            var fsTrackingService = new FilesystemSubscriptionTrackingService(fsTrackingBaseDir);

            fsTrackingService.Init();

            var multicastSection = configuration?.GetSection("multicast");
            var multicastFactory = new MulticastSubscriptionTrackingServiceFactory();

            return(multicastFactory.InitSubscriptionTrackingService(multicastSection, fsTrackingService));
        }
コード例 #2
0
        /// <inheritdoc />
        /// <summary>
        /// Creates an initializes a <see cref="T:Platibus.ISubscriptionTrackingService" />
        /// based on the provided <paramref name="configuration" />.
        /// </summary>
        /// <param name="configuration">The journaling configuration
        /// element.</param>
        /// <returns>Returns a task whose result is an initialized
        /// <see cref="T:Platibus.ISubscriptionTrackingService" />.</returns>
        public Task <ISubscriptionTrackingService> CreateSubscriptionTrackingService(
            SubscriptionTrackingElement configuration)
        {
            var path = configuration.GetString("path");
            var fsTrackingBaseDir = GetRootedDirectory(path);
            var fsTrackingService = new FilesystemSubscriptionTrackingService(fsTrackingBaseDir);

            fsTrackingService.Init();

            var multicast        = configuration.Multicast;
            var multicastFactory = new MulticastSubscriptionTrackingServiceFactory();

            return(multicastFactory.InitSubscriptionTrackingService(multicast, fsTrackingService));
        }