Added job metadata to scheduled jobs.
Handlers can now inspect job metadata by capturing a second argument.
Failed jobs are now retried with an exponential backoff.
You can now debug a specific queue by passing DEBUG=ironium:queues:foobar
.
Debugging all queues now requires DEBUG=ironium:queues:*
.
Fixed processing a subset of scheduled jobs.
You can process a subset of queues in a given Ironium process. See README for configuration.
Now supporting AWS SQS.
Handlers now receive their own copy of the job payload.
We now debug-log the full job in case of error. When using SQS, this includes the receipt handle, which can be used to delete the job.
Schedules now get their own queue.
IronMQ still supported, but untested, unless you bring your own iron.json
.
Concurrency is now a global limit, shared by all queues.
Concurrency can be configured via the IRONIUM_CONCURRENCY
environment
variable. Default is 50.
Delayed jobs can be tested by time traveling.
A scheduled job's time-to-live is equal to its interval. This better matches expectations on transient error conditions.
Ironium will honor BEANSTALKD_HOSTNAME
and BEANSTALKD_PORT
environment
variables if present.
Allow Ironium to be installed on newer versions of Node.
Failed jobs were not being returned to the queue with a delay when using IronMQ.
Minimum interval for scheduled jobs is one minute. Ironium was never designed for short intervals; this change only makes that explicit.
Added processing concurrency. By default, Ironium will run 10 concurrent jobs.
This can be configured via the concurrency
option.
Multiple jobs can be queued in a single API call: Queue#queueJobs(jobs)
.
Dropped support for callbacks and generator functions. Job handlers must return a promise now.
Fixed bug in error handling when queuing scheduled job.
Solved the mysterious case of the undeleted job.
Synchronize multiple workers, so they only schedule each job once.
Fixed reservation timeout, should be 10 minutes, not 1 second.
Fixed back-off timeout, should be 10 minutes, not 1 minute.
Don't reserve and run a job after queue stopped; release with no delay.
Stop Bluebird from complaining about empty promises.
Scheduled jobs should throw, especially for runOnce.
Minor bug fix when running test suite, purgeQueues would fail to work correctly.
Ironium 3.x works with IronMQ v3 and can still run in development mode against Beanstalkd (no authentication).
Ironium 3.x requires Node 4.x or later.
Methods like queueJob, runOnce, etc that previously took a callback no longer accept a callback. Everything returns a promise.
Configuration has changed, so check the README again. You can now use
iron.json
as the configuration object, e.g:
const config = require('iron.json'); ironium.configure(config);
Debug messages have been split. Use DEBUG=ironium to see processing instructions, and DEBUG=ironium:* to see everything else reported.
To listen to processing errors, use ironium.onerror(callback).
To get the webhook URL of a queue, use ironium.webhookURL(queueName). This method returns a promise that resolves to the webhook URL.
The width argument to eachJob is gone (for now).
Upgraded to Bluebird 3.x. This may be a breaking update for some, see http://bluebirdjs.com/docs/new-in-bluebird-3.html#3.0.1-update
ADDED keep alive necessary to keep IronMQ connection open.
Officially only supported on Node.js 4.0 or later.
CHANGED tests that schedule with interval now respect start time.
When scheduling a job to run every 24 hours, it will run at 0:00 starting on the next day.
When scheduling a job to run every 24 hours from the start time. Previously this was not respected in the test suite.
This allows you to run a job every 24 hours at 5:00 by scheduling with:
{ every: '24h', start: new Date(null, null, null, 5) }
ADDED resetSchedule
to help test scheduled jobs.
FIXED runOnce
should continue to honor intervals after first run.
FIXED start time scheduling.
CHANGED when testing, you need to advance the clock to run a scheduled job.
For example:
Ironium.scheduleJob('daily', '24h', function(done) {
console.log('Run daily job');
});
await Ironium.runOnce();
TimeKeeper.travel(Date.now() + ms('24h'));
await Ironium.runOnce();
=> Run daily job
FIXED sometimes errors during job handling go ignored.
FIXED do not swallow processing errors that have the same signature as beanstalkd errors.
FIXED round up schedule to next interval.
FIXED pass jobID to error handler via domain.
FIXED should exit domain after running job handler.
FIXED show queue name / job ID for failed job.
FIXED automatically retry first failed attempt to queue job.
Updated dependencies.
FIXED bug in logging failed job.
CHANGED runOnce throws error, no need to log it as well.
ADDED configures itself from IRON_MQ_PROJECT_ID and IRON_MQ_TOKEN environment variables (e.g. when running in Heroku)
CHANGED run all job handlers at once
ADDED log job processing time
FIXED keep server alive until stop()
FIXED race condition that causes write after end errors
REMOVED deprecated methods.
FIXED bug in purgeQueues.
Updated to Babel.js 4.7.1.
Updated to Babel.js 4.4.5.
FIXED trying to catch "write after" end errors.
Upgraded to 6to5 3.0.
ADDED support for queuing with streams.
For example, to queue all the jobs from the source stream, and log the queued job IDs:
source .pipe( queue.stream() ) .pipe( process.stdout );
ADDED queueJob
as alias for pushJob
and Ironium.queueJob
shortcut.
ADDED you can use queueJob, delayJob, etc without an object reference.
CHANGED switched from Traceur to 6to5, which works much better for 3rd party libraries.
ADDED you can now use pushJob with a string or buffer; objects are always serialized to JSON.
CHANGED push deprecated, use pushJob instead
CHANGED delay deprecated, use delayJob
CHANGED each deprecated, used eachJob instead
CHANGED schedule deprecated, use scheduleJob instead
CHANGED once deprecated, use runOnce instead
CHANGED reset deprecated, use purgeQueues instead
CHANGED width deprecated, use queueWidth instead
FIXED no longer user timeout to detect connection failure, this allows better concurrency for job push on slow connections.
REMOVED "possible EventEmitter memory leak detected" message when we have hundred of writers pushing to the same queue.
ADDED emit error
events and output error message when DEBUG=ironium
ADDED when executing job, current job ID available from process.domain.jobID
Since the domain is accessible in callbacks and event handlers, you can use this to trace the execution of the job, specifically for logging messages.
FIXED make sure to unref all timeout/interval.
ADDED Ironium will output to console if run with DEBUG=ironium
or DEBUG=*
.
ADDED The methods start, stop, once and reset are now bound to an instance of Ironium, so can be passed directly to Mocha before/after methods.
REMOVED No longer emitting error
events.
CHANGED zero timeouts and delay when running in development or test environments
FIXED stupid bug when fetching queued jobs
CHANGED just in case defensive programming at practice
Trying better handling when establishing connection
FIXED was testing error instead of message, incorrect in some envs
FIXED queue processing may stop for some rejected promises
FIXED properly detect error message
CHANGED ignore DRAINING error
CHANGED ignore connection closed error when processing queue
ADDED queue.delay works just like queue.push but delays processing of the job.
queue.delay(job, duration, callback?)
Duration is either a number or a string. The default unit is milliseconds, but you can specify a string with units, such as "5m" or "3 hours".
Valid units are ms
, seconds
, minutes
, hours
, days
and years
. You
can write each unit as plural ("1 hours"), singular ("1 hour") or first letter
only ("1h").
FIXED generate error when one not available
FIXED error handling for sessions and reset
Because ES7, Ironium's API changed to return promises instead of thunks.
If you're using Traceur, and you wanted to duplicate a job in queue0 to queue1 and queue2, you could do this:
queue0.each(async function(job) {
await queue1.push(job);
await queue2.push(job);
});
Upgraded to Traceur 0.0.18.
FIXED: don't block $schedule queue waiting for jobs to run.
CHANGED: workers.once() fails if any scheduled job fails.
FIXED: if request to queue scheduled job fails, try again.
FIXED: scheduled jobs not processed until next schedule.
FIXED: don't care for close errors while reserving jobs.
FIXED: more informative close/error messages.
Upgraded to Traceur 0.0.10.
FIXED: should not warn about closed connection, unless it interrupts request.
CHANGED: schedule time should be ISO string.
CHANGED: session ID now indicates if it's put session or worker number.
FIXED: error handling for connection close/error without using timeout.
FIXED: trying to work around Iron.io disconnect issue.
CHANGED: documentation uses ironium
instead of workers
.
FIXED: connection errors not reported correctly.
FIXED: bug when cleaning out Beanstalkd queue.
CHANGED: use of queues on their own will not prevent process from completing.
FIXED: scheduled jobs not running in production.
FIXED: hostname/port not picked up from configuration.
Configuration gets separate section for setting up Iron.io server.
Scheduler now queues job for execution, this will allow using a scheduler service.
Scheduler now accepts scheduled time as either Date, interval (number or string), or an object with start time, end time and interval.
Methods like once
, reset
and push
now return thunks instead of promises.
Disappointing for some, but easier for those of us using
Mocha and
co.
Testing with Travis-CI.
Fixed: need Error object when reporting connection closed
Use monolithed/ECMAScript-6 to implement promises.
Removed workers.fulfill
, please use
thunks instead.
Minor performance improvement.
Removed workers.push
and workers.each
, referencing queues is better for
testing.
Renamed count to width (number of workers used in parallel).
Tests!
Allow multiple queue handlers.
Added workers.push
, workers.each
and workers.webhookURL
convenience
methods.
Using co.
Added workers.fulfill
to ease using generators with callbacks.
Added documentation for logging.
Preliminary support for generators.
Use native Promise instead of Q.