
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
griffon-client
Advanced tools
A NodeJS Client for Griffon workflows.
Griffon is a message queue for easily building workflows. A griffon server acts a hub, connecting griffon clients. Clients connect and kickoff tasks within a workflow, then relay the results when they are done. Griffon tracks dependecies as clients connect, and provides a powerful architecture for developing against, debugging, and running complex workflows.
Griffon clients require a running Griffon server, see installing and running a Griffon Server. It's a snap to set up.
npm install griffon-client
The following is a simple example of useage
const griffon = require('griffon-client')
const operator = await griffon.connect({
uri: 'http://localhost:3001',
environment: 'local',
operator: 'test',
produce: ['topic1', 'topic2'],
consume: ['topic1', 'topic2'],
})
operator.consume('topic1', async task => {
console.log(task)
await task.produce({
topic: 'topic2',
data: 'World'
})
})
operator.consume('topic2', async task => {
console.log(task)
})
await operation.produce({
topic: 'topic1',
data: 'Hello'
})
The following is a complete example:
const griffon = require('griffon-client')
const operator = await griffon.connect({
uri: 'http://localhost:3001',
username: 'admin',
password: 'password',
environment: 'local',
operator: 'test1',
channels: ['.*'],
consume: {and: ['topic1', 'topic2']},
produce: ['topic3', 'topic4'],
})
operator.consume(async operation => {
console.log(operation)
const output = operation.data.topic1.toUpperCase() + operation.data.topic2.toLowerCase()
console.log(output)
await operation.produce({
topic: 'topic3',
data: output + 3
})
await operation.produce({
topic: 'topic4',
data: output + 4
})
})
setTimeout(async () => {
const operator = await griffon.connect({
uri: 'http://localhost:3001',
username: 'admin',
password: 'password',
environment: 'local2',
consume: {and: ['topic1', 'topic2']},
channels: ['dev'],
operator: 'test1',
produce: ['topic3', 'topic4'],
})
operator.consume(async operation => {
console.log(operation)
const output = operation.data.topic1.toUpperCase() + operation.data.topic2.toLowerCase()
console.log(output)
await operation.produce({
topic: 'topic3',
data: output + 3
})
await operation.produce({
topic: 'topic4',
data: output + 4
})
})
}, 2000)
FAQs
Griffon client
The npm package griffon-client receives a total of 0 weekly downloads. As such, griffon-client popularity was classified as not popular.
We found that griffon-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.