ssh-queue
Queues SSH commands to be executed one by one.
Created after encountering a situation where too many simultaneous connection attempts were being made to an external machine.
Wrapper for node-ssh.
Example
const sshQueue = // Sets params for all future connectionssshQueue // Access the currently stored connection parameterssshQueue // Queues upload of localFile to remoteFilesshQueue // Queues download of remoteFile to localFilesshQueue // Queues execution of commandsshQueuesshQueuesshQueue// and so on, for any command // Access the current length of the queuelet queueLength = sshQueue
sshQueue maintains a list of queued interactions with the remote machine (command executions, filePuts, and fileGets), which it works through one by one. A connection is opened when the queue becomes longer than zero, this connection is then maintained until the queue is empty again, at which point it is disposed of.
Connecting and disconnecting is handled automatically, but can be manually triggered via:
sshQueue sshQueue
License
This project is licensed under the terms of MIT license. See the LICENSE file for more info.