Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

worksmith_etcd

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

worksmith_etcd

Etcd activites for worksmith

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

worksmith_etcd

Etcd activities for worksmith

This package contains the following activities/tasks:

namedescription
createClientCreates an etcd client
lockCreates a distributed lock using etcd
unlockReleases a distributed lock created with the lock activity

createClient activity

Creates an etcd client

params
nametypedescription
hostsarrayArray of hosts
example
var worksmith = require('worksmith')
worksmith.use('etcd', require('worksmith_etcd'))
var workflow = worksmith({task:"sequence", items : [{
    task:'etcd/createClient',
    hosts: ['localhost:4001']
    resultTo: 'etcd'
}])

lock activity

Creates a distributed lock using etcd

params
nametypedescription
etcdetcd clientThe etcd client (if not specified expected to be in the context 'etcd' property)
keystringThe etcd key to be used in the lock
valuestringOptional value for the lock, defaults to a uuid
ttlintegerOptional time in secords before the lock automatically expires
example
var worksmith = require('worksmith')
worksmith.use('etcd', require('worksmith_etcd'))
var workflow = worksmith({task:"sequence", items : [{
    task:'etcd/createClient',
    hosts: ['localhost:4001']
    resultTo: 'etcd'
}, {
    task:"etcd/lock",
    key:"record_12345"
    resultTo: "lock.value"
}])

unlock activity

Releases a distributed lock created with the lock activity

params
nametypedescription
etcdetcd clientThe etcd client (if not specified expected to be in the context 'etcd' property)
keystringThe etcd key to be used in the lock
valuestringOptional value for the lock. If specified both the key and lock must match
example
var worksmith = require('worksmith')
worksmith.use('etcd', require('worksmith_etcd'))
var workflow = worksmith({task:"sequence", items : [{
    task:'etcd/createClient',
    hosts: ['localhost:4001']
    resultTo: 'etcd'
}, {
    task:"etcd/unlock",
    key:"record_12345"
}])

Running tests

You need an etcd server running on localhost:4001 for the tests to pass. If you have docker and docker-compose installed simply run docker-compose up in the route of this project, however watch out for this bug.

Keywords

FAQs

Package last updated on 23 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc