//internal EventStreamResponse( // HttpResponseMessage httpResponse, // ValueAddedEventHandler added = null, // ValueChangedEventHandler changed = null, // ValueRemovedEventHandler removed = null) //{ // _cancel = new CancellationTokenSource(); // _cache = new TemporaryCache(); // if (added != null) // { // _cache.Added += added; // } // if (changed != null) // { // _cache.Changed += changed; // } // if (removed != null) // { // _cache.Removed += removed; // } // _pollingTask = ReadLoop(httpResponse, _cancel.Token); //} internal EventStreamResponse( IRequestManager requestManager, string listenPath, ValueAddedEventHandler added = null, ValueChangedEventHandler changed = null, ValueRemovedEventHandler removed = null) { this._requestManager = requestManager; this._listenPath = listenPath; _cancel = new CancellationTokenSource(); _cache = new TemporaryCache(); if (added != null) { _cache.Added += added; } if (changed != null) { _cache.Changed += changed; } if (removed != null) { _cache.Removed += removed; } }
private void OnNewUpdate( IRequestManager<ConfigurationUpdate, ConfigurationUpdateAnswer> sender, RequestMessage<ConfigurationUpdate> request) { var newConfiguration = request.request.update; //Not the most efficient code, but premature optimisation is root of evil. lock (internalLock) { var existing = allConfigurations.FirstOrDefault(o => o.Instance == newConfiguration.Instance && o.Key == newConfiguration.Key ); if (existing != null) { existing.Value = newConfiguration.Value; } else { allConfigurations.Add(newConfiguration); } } this.persister.Persist(allConfigurations); //Todo here broadcast the update? sender.Send(new AnwserMessage<ConfigurationUpdateAnswer>() { id = request.id, answer = new ConfigurationUpdateAnswer() { result = true } }); }
public ConfigurationRequestHandler( IRequestManager<ConfigurationSubscription, ConfigurationSubscriptionAnswer> subscriptionsRequestSource, IRequestManager<ConfigurationUpdate, ConfigurationUpdateAnswer> updateRequestManager, IStatePersister persister) { this.persister = persister; this.allConfigurations = persister.Read(); subscriptionsRequestSource.OnRequest += (sender, message) => OnNewSubscription(subscriptionsRequestSource,message); updateRequestManager.OnRequest += (sender, message) => OnNewUpdate(updateRequestManager,message); }
public void MyTestInitialize() { if (_target == null) { var catalog = new DirectoryCatalog(@"..\..\..\Plugins"); var container = new CompositionContainer(catalog); _target = container.GetExportedValue<IRequestManager>(); string graph = "AB5, BC4, CD8, DC8, DE6, AD5, CE2, EB3, AE7"; _target.LoadGraph(graph); } }
public ApiFactory() { JsonConvert.DefaultSettings = () => new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, DateFormatString = "dd.MM.yyyy", ContractResolver = new LowercaseContractResolver() }; _requestManager = new RequestManager(); _creatorDomainProvider = new Func<IDomainProvider>(() => new DomainProvider(_requestManager)); _creatorAutorizationProvider = new Func<IAutorizationProvider>(() => new AutorizationProvider(_requestManager)); }
private void OnNewSubscription( IRequestManager<ConfigurationSubscription, ConfigurationSubscriptionAnswer> sender, RequestMessage<ConfigurationSubscription> request) { IEnumerable<Configuration> result; //Not the most efficient code, but premature optimisation is root of evil. lock (internalLock) { var instanceFilter = request.request.instance; var matchingConfigurations = instanceFilter == ConfigurationInstanceWildcard ? allConfigurations : allConfigurations.Where(o => o.Instance == instanceFilter); result = matchingConfigurations; } sender.Send(new AnwserMessage<ConfigurationSubscriptionAnswer>() { id = request.id, answer = new ConfigurationSubscriptionAnswer() { result = result.ToList() } }); }
public ContactController(IRequestManager requestManager) : base(requestManager) { }
public APIContributionController(IRequestManager requestManager) : base(requestManager) { }
public TransactionsController(IRequestManager requestManager) : base(requestManager) { }
public FinanceReportsController(IRequestManager requestManager) : base(requestManager) { }
public ProductManager(IRequestManager requestManager) { _requestManager = requestManager; }
public CheckinTimeController(IRequestManager requestManager) : base(requestManager) { }
public GetProductDataIdentifiedCommandHandler(IMediator mediator, IRequestManager requestManager) : base(mediator, requestManager) { }
public ChAiPeopleController(IRequestManager requestManager) : base(requestManager) { }
public ExternalServicesController(IRequestManager requestManager) : base(requestManager) { }
public CheckInController(IRequestManager requestManager) : base(requestManager) { }
public QueryController(IRequestManager requestManager) : base(requestManager) { }
public MeetingsController(IRequestManager requestManager) : base(requestManager) { }
internal FirebaseClient(IRequestManager requestManager) { _requestManager = requestManager; }
/// <summary> /// For testing purposes only (Mock) /// </summary> /// <param name="requestManager"></param> public FirebaseClient(IRequestManager requestManager, IFirebaseConfig config) { this.Serializer = config.Serializer; _requestManager = requestManager; }
public ChAiGiftsController(IRequestManager requestManager) : base(requestManager) { }
public DeleteMeetingController(IRequestManager requestManager) : base(requestManager) { }
public ApiRequestHandler(IRequestManager requestManager) { RequestManager = requestManager; }
public RegSettingController(IRequestManager requestManager) : base(requestManager) { }
public AnonymizeGdprDataIdentifiedCommandHandler(IMediator mediator, IRequestManager requestManager) : base(mediator, requestManager) { }
public AccountController(IRequestManager requestManager) : base(requestManager) { }
public IdentifierCommandHandler(IMediator mediator, IRequestManager requestManager) { this._mediator = mediator ?? throw new ArgumentNullException(nameof(mediator)); this._requestManager = requestManager ?? throw new ArgumentNullException(nameof(requestManager)); }
public PictureDirectoryController(IRequestManager requestManager) : base(requestManager) { }
public static bool FindPage(string pageUrl, IRequestManager requestManager) { if (_pageLanguageIndex == null) { IndexSite(); } var pageIndex = GetPageIndex(Language.CurrentLanguageId); if (pageIndex.Items.Count == 0) { return(false); } var segments = GetUrlSegments(pageUrl); var position = 0; var lastPage = new PageIndexItem(); for (var i = 0; i < segments.Length; i++) { var segment = segments[i]; var segmentHash = segment.GetHashCode(); while (true) { var page = pageIndex.Items[position]; if ((page.UrlSegmentHash == segmentHash) && (page.UrlSegment == segment)) { if (i == segments.Length - 1) { requestManager.HandlePage(page); return(true); } lastPage = page; position = page.FirstChild; if (position == -1) { if (TryAsPageExtender(i + 1, segments, lastPage)) { return(true); } if (requestManager.TryMvcSupport(i + 1, segments, lastPage)) { return(true); } if (TryAsRedirect(pageUrl)) { return(true); } return(false); } // Continue to next segment break; } position = page.NextPage; if (position == -1) { if (TryAsPageExtender(i, segments, lastPage)) { return(true); } if (requestManager.TryMvcSupport(i, segments, lastPage)) { return(true); } if (TryAsRedirect(pageUrl)) { return(true); } return(false); } } } return(false); }
public CreateOrderIdentifiedCommandHandler(IMediator mediator, IRequestManager requestManager) : base(mediator, requestManager) { }
public BundleHeaderTypesController(IRequestManager requestManager) : base(requestManager) { }
public SetStockConfirmedOrderStatusIdenfifiedCommandHandler(IMediator mediator, IRequestManager requestManager) : base(mediator, requestManager) { }
public IdentifiedCommandHandler(IMediator mediator, IRequestManager requestManager) { _mediator = mediator; _requestManager = requestManager; }
public LookupController(IRequestManager requestManager) : base(requestManager) { }
public SearchTicketApiFactory() { _requestManager = new RequestManager(); _creatorUserInfoProvider = new Func<IUserInfoProvider>(() => new UserInfoProvider(_requestManager)); _creatorDataInfoProvider = new Func<IDataInfoProvider>(() => new DataInfoProvider(_requestManager)); _creatorPopularRoutesProvider = new Func<IPopularRoutesProvider>(() => new PopularRoutesProvider(_requestManager)); _creatorSearchTicketsProvider = new Func<ISearchTicketsProvider>(() => new SearchTicketsProvider(_requestManager)); _creatorSimpleSearchTicketsProvider = new Func<ISimpleSearchTicketsProvider>(() => new SimpleSearchTicketsProvider(_requestManager)); }
public UserInfoProvider(IRequestManager requestManager) : base(requestManager) { _uriBuilder = new UriBuilder { Scheme = GeneralSettings.ShemaName, Port = -1 }; }
public FirebaseClient(IFirebaseConfig config) { this.Serializer = config.Serializer; this.JsonPatcher = new JsonPatcher(this.Serializer); _requestManager = new RequestManager(config); }
public AutorizationProvider(IRequestManager requestManager) : base(requestManager) { }
public BaseApiProvider(IRequestManager requestManager) { _requestManager = requestManager; }
public SimpleSearchTicketsProvider(IRequestManager requestManager) : base(requestManager) { }
public RemoveOrderItemFromOrderIdentifiedCommandHanlder(IMediator mediator, IRequestManager requestManager) : base(mediator, requestManager) { }
public PopularRoutesProvider(IRequestManager requestManager) : base(requestManager) { }
public DomainProvider(IRequestManager requestManager) : base(requestManager) { }