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

taskcluster-client

Package Overview
Dependencies
Maintainers
1
Versions
433
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

taskcluster-client - npm Package Compare versions

Comparing version 0.0.0-alpha to 0.0.0-alpha.1

factory/task.js

11

config.js

@@ -15,3 +15,11 @@ /**

/**
Default location where task definitions can be fetched from.
@constant
*/
var DEFAULT_TASKCLUSTER_TASK_BUCKET = 'http://tasks.taskcluster.net';
/**
@param {Object} [options] configuration details for TC.
@param {Object} [options.queueUrl] protocol + host for queue url.
@param {Object} [options.tasksUrl] protocol + host for tasks location.
@return {Object} full configuration for taskcluster

@@ -23,3 +31,4 @@ */

return {
queueUrl: options.queueUrl || DEFAULT_TASKCLUSTER_QUEUE
queueUrl: options.queueUrl || DEFAULT_TASKCLUSTER_QUEUE,
tasksUrl: options.tasksUrl || DEFAULT_TASKCLUSTER_TASK_BUCKET
};

@@ -26,0 +35,0 @@ }

6

exchange_test.js
suite('exchange', function() {
var exchange = require('./exchange');
suite('routingKey', function() {
suite('#taskRoutingKey', function() {
test('defaults', function() {
assert.equal(
exchange.routingKey(),
exchange.taskRoutingKey(),
'*.*.*.*.*.*.#'

@@ -32,3 +32,3 @@ );

assert.equal(
exchange.routingKey(object),
exchange.taskRoutingKey(object),
expected.join('.')

@@ -35,0 +35,0 @@ );

@@ -65,3 +65,3 @@ /**

var routingKey = exchange.routingKey({
var routingKey = exchange.taskRoutingKey({
provisionerId: 'aws-provisioner',

@@ -74,3 +74,3 @@ workerType: 'ami-xfoo'

*/
exports.routingKey = function routingKey(options) {
exports.taskRoutingKey = function(options) {
options = options || {};

@@ -77,0 +77,0 @@

@@ -6,3 +6,5 @@ module.exports = function(grunt) {

'config.js',
'exchange.js'
'exchange.js',
'queue.js',
'factory/task.js'
];

@@ -9,0 +11,0 @@

{
"name": "taskcluster-client",
"version": "0.0.0-alpha",
"version": "0.0.0-alpha.1",
"description": "mozilla taskcluster client",
"main": "index.js",
"scripts": {
"test": "make test"
"test": "make test",
"doc": "./node_modules/.bin/grunt jsdoc"
},

@@ -26,4 +27,4 @@ "repository": {

"superagent-promise": "0.0.0",
"amqplib": "~0.1.3",
"url-join": "0.0.1"
"url-join": "0.0.1",
"object-factory": "~0.1.2"
},

@@ -30,0 +31,0 @@ "devDependencies": {

@@ -7,4 +7,20 @@ # taskcluster-client

## Environment configuration
## Developing
`TASKCLUSTER_QUEUE` - taskcluster queue location (defaults to queue.taskcluster.net)
Right now both a simple Makefile AND a Gruntfile are used (based on
whatever I felt had the best tooling)... The source of truth for
commands is the package.json... See the scripts section for how to run
project wide tooling.
### Run all the tests
```sh
npm test
```
### Generate the docs
```sh
npm run-script doc
```

@@ -11,3 +11,3 @@ Its fairly easy to bind everything yourself with amqp but there is quite

var exchange = require('taskcluster-client/exchange');
var route = exchange.routingKey();
var route = exchange.taskRoutingKey();

@@ -27,11 +27,16 @@ module.exports = new AmqpSchema({

// app.js
var amqp = require('taskcluster-client/amqp');
var Queue = require('taskcluster-client/queue');
var amqp = require('amqplib');
var schema = require('./schema');
// declare your apps amqp schema (this is idempotent so you can run this
safely on app startup).
var api = new Queue();
amqp().then(function(connection) {
return schema.define(connection);
api.amqpConnectionString().then(funciton(credentials) {
amqp.connect(credentials.url).then(function(connection) {
// define your amqp schema (this is idempontent...
return schema.define(connection);
});
});
```

@@ -38,0 +43,0 @@

Sorry, the diff of this file is not supported yet

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