Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Version 1.0 of fivebeans #10

Merged
merged 21 commits into from

1 participant

C J Silverio
C J Silverio
Owner

Removed callbacks on client.connect() in favor of events.

Removed logging from the worker in favor of events.

Greatly improved testing code coverage. Fixed revealed bugs.

You can now specify a delay of 0 when releasing jobs in the worker.

The worker can now be restarted after stop.

Implemented kick-job .

Improved documentation, especially worker documentation.

Brought code style in line with my current node habits.

added some commits
C J Silverio Begin bringing this module up to my current standards for node modules.
- main is now index.js
- each submodule in lib now exports one item
- fixed some small style things
- added code coverage tools to the test harness

Pre-bumped the version number because this will be an API-breaking release.

Next up: removing logging.
1748d1b
C J Silverio The worker now emits 'log' events instead of attempting to log all by…
… itself.

Documentation to follow in the readme once I'm happy with the format of the
objects passed to the event.
8883f39
C J Silverio Slight test reorganization, prepping for some worker & runner tests. 34b40cb
C J Silverio The client now emits errors on interesting events like connect, close…
…, and error.

You are expected to listen for those events and act upon them. In particular, the
API has changed to that connect no longer takes a callback.

worker.start() no longer takes a flag to ignore the default tube. Instead you
can set 'ignoreDefault' in the options hash you pass to the worker constructor.

The worker no longer attempts to ignore the default tube if it's not watching
anything else.

Started implementing tests for the worker. This brings coverage up over
50% (which is pathetic, but it's a start) so I added coverage checking
to the test targets run by Travis CI.
a5e7cc2
C J Silverio More logger expungement.
I just invented that word.
772d470
C J Silverio Some style tightening.
More worker tests.
54cfb50
C J Silverio A little whitespace now & then / is relished by the wisest of men. a4ce59b
C J Silverio The worker is now restartable.
That is, you can call stop() and then start() on it without needing to
create a new one. You'll still need to re-watch any tubes you were
watching. (Going to rework that, at which point this client will be far
divorced from the original project.)

Implemented more worker tests. Client test coverage is now at 91% and
worker coverage at 92%.
6f42c30
C J Silverio Added two more worker job-handling tests.
The bad json test exposed a bug, which I fixed: we would cheerfully go
on to try to use a bad job payload. Yay integration tests.
c81732a
C J Silverio Travis test timings are much slower than on my MacBook.
I read that virtualization means I'm running these tests on the
equivalent of a RaspberryPI, which is awesome. Anyway, try to work
around the timing differences while maintaining the usefulness of the
tests.
8fae5cc
C J Silverio The worker emits many more events to make processing jobs a little ni…
…cer.

Well, as scientifically measured, about a million times nicer.

Here is a list of events emitted and some notes on what they mean. This
will turn into documentation eventually:

error: payload is error; cannot be recovered from
close: worker got a close event from its client; no payload

warning: payload is object with error information; execution continues
info: the equivalent of info-level logging; payload is object with
action info

started: worker has started processing jobs; no payload
stopped: worker has stopped processing jobs; no payload

job.reserved: payload is jobid
job.handled: payload is object with job info
job.deleted: payload is jobid
job.destroyed: payload is jobid
job.buried: payload is jobid

Rewrote the tests to use the events, which should make them less
timing-dependent. I might still not be allowing enough slop for the
slowness of TravisCI.
dbbd87a
C J Silverio Bump up the timeout on two worker tests.
These are consistently passing for me, so perhaps it's just that the
tests are running on a RaspberryPI hosted at Amazon.
b91fcbe
C J Silverio Implemented the kick-job <id> command, with unit test. b54260f
C J Silverio Don't test kick-job if the version of beanstalkd doesn't support it.
kick-job was introduced in 1.8 in Nov 2012. Apparently the package
Travis installs is older than that.

Used semver to compare versions because I am very lazy.
481de1d
C J Silverio Resequence some tests. 6a815d6
C J Silverio You can now specify a delay of 0 when releasing jobs.
And use that in the worker release test, to completely removing timing
issues from the test. This should fix Travis. Famous last words.
9594702
C J Silverio Added basic tests for the runner.
Code coverage is now up over 90%, so I set the travis-cov threshold to
90. Next up: documentation.
932d912
C J Silverio Mark version as 1.0.0-beta1 so I can push a beta to npm later. 717e519
C J Silverio Brought documentation up to date.
Documented the new client.connect() behavior.
Documented the new worker events. Improved worker documentation overall.
6312222
C J Silverio Brought examples up to date.
They all run.
0dc3cb3
C J Silverio Reformatting docs for usability. 94db5ea
C J Silverio ceejbot merged commit 33c54a1 into from
C J Silverio ceejbot deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 4, 2013
  1. Begin bringing this module up to my current standards for node modules.

    authored
    - main is now index.js
    - each submodule in lib now exports one item
    - fixed some small style things
    - added code coverage tools to the test harness
    
    Pre-bumped the version number because this will be an API-breaking release.
    
    Next up: removing logging.
  2. The worker now emits 'log' events instead of attempting to log all by…

    authored
    … itself.
    
    Documentation to follow in the readme once I'm happy with the format of the
    objects passed to the event.
  3. The client now emits errors on interesting events like connect, close…

    authored
    …, and error.
    
    You are expected to listen for those events and act upon them. In particular, the
    API has changed to that connect no longer takes a callback.
    
    worker.start() no longer takes a flag to ignore the default tube. Instead you
    can set 'ignoreDefault' in the options hash you pass to the worker constructor.
    
    The worker no longer attempts to ignore the default tube if it's not watching
    anything else.
    
    Started implementing tests for the worker. This brings coverage up over
    50% (which is pathetic, but it's a start) so I added coverage checking
    to the test targets run by Travis CI.
Commits on May 5, 2013
  1. More logger expungement.

    authored
    I just invented that word.
  2. Some style tightening.

    authored
    More worker tests.
  3. The worker is now restartable.

    authored
    That is, you can call stop() and then start() on it without needing to
    create a new one. You'll still need to re-watch any tubes you were
    watching. (Going to rework that, at which point this client will be far
    divorced from the original project.)
    
    Implemented more worker tests. Client test coverage is now at 91% and
    worker coverage at 92%.
  4. Added two more worker job-handling tests.

    authored
    The bad json test exposed a bug, which I fixed: we would cheerfully go
    on to try to use a bad job payload. Yay integration tests.
  5. Travis test timings are much slower than on my MacBook.

    authored
    I read that virtualization means I'm running these tests on the
    equivalent of a RaspberryPI, which is awesome. Anyway, try to work
    around the timing differences while maintaining the usefulness of the
    tests.
  6. The worker emits many more events to make processing jobs a little ni…

    authored
    …cer.
    
    Well, as scientifically measured, about a million times nicer.
    
    Here is a list of events emitted and some notes on what they mean. This
    will turn into documentation eventually:
    
    error: payload is error; cannot be recovered from
    close: worker got a close event from its client; no payload
    
    warning: payload is object with error information; execution continues
    info: the equivalent of info-level logging; payload is object with
    action info
    
    started: worker has started processing jobs; no payload
    stopped: worker has stopped processing jobs; no payload
    
    job.reserved: payload is jobid
    job.handled: payload is object with job info
    job.deleted: payload is jobid
    job.destroyed: payload is jobid
    job.buried: payload is jobid
    
    Rewrote the tests to use the events, which should make them less
    timing-dependent. I might still not be allowing enough slop for the
    slowness of TravisCI.
  7. Bump up the timeout on two worker tests.

    authored
    These are consistently passing for me, so perhaps it's just that the
    tests are running on a RaspberryPI hosted at Amazon.
  8. Don't test kick-job if the version of beanstalkd doesn't support it.

    authored
    kick-job was introduced in 1.8 in Nov 2012. Apparently the package
    Travis installs is older than that.
    
    Used semver to compare versions because I am very lazy.
  9. Resequence some tests.

    authored
  10. You can now specify a delay of 0 when releasing jobs.

    authored
    And use that in the worker release test, to completely removing timing
    issues from the test. This should fix Travis. Famous last words.
  11. Added basic tests for the runner.

    authored
    Code coverage is now up over 90%, so I set the travis-cov threshold to
    90. Next up: documentation.
  12. Brought documentation up to date.

    authored
    Documented the new client.connect() behavior.
    Documented the new worker events. Improved worker documentation overall.
  13. Brought examples up to date.

    authored
    They all run.
Something went wrong with that request. Please try again.