Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Nodejs nano library to handle couchdb: need a timeout     - C # compiler to achieve functional use in the runtime (Programming)

- Linux Log (Linux)

- The need to avoid a gap of InnoDB lock (Database)

- Shell generated using automated configuration script Orabbix (Database)

- MongoDB uses aggregate, group, match mysql achieve in having (count (1)> 1) features (Database)

- Zabbix installation under Linux (Server)

- Linux System Getting Started Tutorial: Using the Linux common commands (Linux)

- Recover accidentally deleted Nginx logs (Server)

- After Ubuntu Password Forgot your way back (Linux)

- Ubuntu 15.04 install Complete Guide (Linux)

- GitLab Installation Guide -Ubuntu 14.04 LTS (Server)

- CentOS source installation GitLab Chinese Version (Server)

- C # asynchronous delegates (Programming)

- MySQL log from the library than the main library (Database)

- A drop datafile Oracle bug (Database)

- Linux mount command Detailed (Linux)

- 22 Port weak passwords and SSH connection program of the Linux server (Linux)

- To install the latest version of the EPEL on CentOS 5.x or 6.x (Linux)

- KUbuntu / Ubuntu 14.04 (downgrade) installed SVN 1.7 (Linux)

- Forwarding module with Apache reverse proxy server (Server)

 
         
  Nodejs nano library to handle couchdb: need a timeout
     
  Add Date : 2018-11-21      
         
         
         
  I want to use nano library. I used db.search / db.get / db.destroy / db.insert, but there is no way to add timeout.

There are many async callback function can be passed as a parameter. I do not want to modify the callback, there is no other way?

--------------------------------------solution---------- ----------------------------------

Use nano, you can provide an object that is passed to the request object:

1. [Code] [text]

var db = require ( 'nano') ({ "requestDefaults": { "proxy": "http: // someproxy"}});

To change the timeout, you can use the timeout attribute:

2. [Code] [text]

var db = require ( 'nano') ({
   "Uri": "http: // localhost: 5984 / mydb",
   "RequestDefaults": { "timeout": "100"} // in miliseconds
});

Linux, the default timeout is probably 20000ms, 20 seconds.
     
         
         
         
  More:      
 
- Ubuntu under shadowsocks configuration instructions (Linux)
- How to Install Linux kernel 4.0 on Ubuntu / CentOS (Linux)
- CentOS 6.5 system installation Oracle11.2.0.4 basic steps (Database)
- Ubuntu server 8.04 Firewall Guide (Linux)
- Install Java 8 on Ubuntu using PPA (Linux)
- Install Redis 2.6 5.5 32 position CentOS error resolved (Linux)
- Node.js Getting the basics: Helloworld! (Linux)
- Linux environment to configure Apache + Django + wsgi (Server)
- Ubuntu 14.04 How to set up an SSH without password (Linux)
- How to make a U disk to install Ubuntu (Linux)
- Examples of testing and installation Mesos on CentOS (Linux)
- How Linux system password security guarantee (Linux)
- To install and use Docker under linux (Server)
- IOS distributed management using GitHub project development (Linux)
- MySQL server after an unexpected power outage can not start (Database)
- Ubuntu 32 compile Android 4.0.4 Problems (Linux)
- Wine 1.7 is installed on a system based on RedHat or Debian (Linux)
- MySQL5.7 implement virtual column expression index (Database)
- How to publish projects to the Jcenter repository using Gradle in Android Studio (Programming)
- Scope of variables in Object-C (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.