
Security News
Rspack Introduces Rslint, a TypeScript-First Linter Written in Go
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
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
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
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.