Ejemplo n.º 1
0
        public static IFlagshipClient Start(string environmentId, string apiKey, FlagshipOptions options = null)
        {
            var context        = new FlagshipContext(environmentId, apiKey, options);
            var flagshipClient = new FlagshipClient(context);

            return(flagshipClient);
        }
Ejemplo n.º 2
0
        public FlagshipContext(string environmentId, string apiKey, FlagshipOptions options = null)
        {
            EnvironmentId    = environmentId;
            ApiKey           = apiKey;
            Options          = options;
            Logger           = options?.Logger ?? new DefaultLogger();
            ExceptionHandler = options?.ExceptionHandler ?? new DefaultExceptionHandler(Logger);
            Sender           = new Sender(this);

            var decisionMode = options?.DecisionMode ?? Mode.API;

            if (decisionMode == Mode.Bucketing)
            {
                DecisionManager = new BucketingClient(this);
            }
            else
            {
                DecisionManager = new APIDecisionManager(this);
            }
        }