Пример #1
0
        public EventServiceListener(IFeatureRepositoryContext repository, IFeatureHubConfig config)
        {
            _repository  = repository;
            _featureHost = config;

            // tell the repository about how evaluation works
            // this means features don't need to know about the IEdgeService
            _repository.ServerSideEvaluation = config.ServerEvaluation;
        }
Пример #2
0
        public IClientContext NewContext(IFeatureRepositoryContext repository = null, EdgeServiceSource edgeServiceSource = null)
        {
            if (repository == null)
            {
                repository = Repository;
            }

            if (edgeServiceSource == null)
            {
                edgeServiceSource = (repo, config) => FeatureHubConfig.defaultEdgeProvider(repo, config);
            }

            if (_serverEvaluation)
            {
                return(new ServerEvalFeatureContext(repository, this, edgeServiceSource));
            }

            return(new ClientEvalFeatureContext(repository, this, edgeServiceSource));
        }
Пример #3
0
 public BaseClientContext(IFeatureRepositoryContext repository, IFeatureHubConfig config)
 {
     _repository = repository;
     _config     = config;
 }
Пример #4
0
 public ClientEvalFeatureContext(IFeatureRepositoryContext repository, IFeatureHubConfig config,
                                 EdgeServiceSource edgeServiceSource) : base(repository, config)
 {
     _edgeService      = edgeServiceSource(repository, config);
     _weCreatedSources = false;
 }