Exemple #1
0
        private static bool Handler(CtrlType sig)
        {
            Console.WriteLine("Exiting system due to external CTRL-C, or process kill, or shutdown");

            //Closes Couchbase Connection
            CouchbaseConnector.CloseCouchbaseConnection();
            //shutdown right away so there are no lingering threads
            Environment.Exit(-1);
            return(true);
        }
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime applicationLifetime)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseCors(options => options.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
            app.UseMvc();
            app.UseSwagger();
            app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "Web Api Couchbase Reader"));
            applicationLifetime.ApplicationStopped.Register(() => CouchbaseConnector.CloseCouchbaseConnection());
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors();
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            services.AddSwaggerGen(c => c.SwaggerDoc("v1", new Info {
                Title       = "Web Api Couchbase Reader",
                Version     = "v1",
                Description = "Api for data consumption of couchbase",
            }));

            CouchbaseConnector.OpenCouchbaseConnection();
        }
Exemple #4
0
        static void Main(string[] args)
        {
            //Set up handler to be fired when console closes
            _handler += new EventHandler(Handler);
            SetConsoleCtrlHandler(_handler, true);

            Console.WriteLine("Initializing Robot...");

            SqlServerDataContext dataContext = new SqlServerDataContext();

            CouchbaseConnector.OpenCouchbaseConnection();

            RabbitListener listener = new RabbitListener(dataContext);

            listener.ReceiveMessageOnQueue("client_browser_info");
            listener.ReceiveMessageOnQueue("client_purchase_info");
            listener.ReceiveMessageOnQueue("client_user_info");
        }
 public BrowserInformationController()
 {
     _bucket = CouchbaseConnector.GetBucketInstance();
 }
        public void RunTest()
        {
            var connector = new CouchbaseConnector();

            connector.TestCouch();
        }
Exemple #7
0
 public ProductController()
 {
     _bucket = CouchbaseConnector.GetBucketInstance();
 }
 public UserController()
 {
     _bucket = CouchbaseConnector.GetBucketInstance();
 }