Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodejs/node-v0.x-archive
base: 48d05e9f1017^
Choose a base ref
...
head repository: nodejs/node-v0.x-archive
compare: 30902485c4c1
Choose a head ref
  • 19 commits
  • 57 files changed
  • 3 contributors

Commits on Oct 17, 2013

  1. node: don't share state with in_tick/last_threw

    There was no need to share state between C++ and JS for these two
    values. So they have been moved to their respective locations. This will
    help performance only a tiny bit, but it does help code complexity much
    more.
    trevnorris committed Oct 17, 2013
    Copy the full SHA
    48d05e9 View commit details
    Browse the repository at this point in the history
  2. node: add AsyncListener support

    The AsyncWrap class has been added as a base class for everything that
    will be performing an asynchronous request. This is meant to be a
    simpler way to track when requests have gone out, and to allow users
    hooks to know when this happens.
    
    Currently only ReqWrap and HandleWrap are covered. Full support will be
    added in the future for all the *Wrap classes.
    
    This comes with a new API:
    
    * process.createAsyncListener(listener, callbacks, domain): This will
      create an AsyncListener instance that can be added and removed when
      necessary. The "domain" passed will propagate to each callback unless
      the listener at some point returns a new object.
      Returns the new AsyncListener instance.
    
    * process.addAsyncListener(listener, callbacks, domain): Will create a
      new AsyncListener instance and immediately add it to the listening
      queue.
      Returns the new AsyncListener instance.
    
    * process.removeAsyncListener(instance): Remove an AsycListener instance
      from the current queue and stack.
      Returns undefined.
    
    Explanations for each callback:
    
    * listener(): Callback that's called immediately when a *Wrap, Timer or
      nextTick is queued.
    
    * callbacks.before(context, domain): Run immediately before the async
      callback is about to run. "context" is the "this" of the caller,
      except in the case of nextTick. Where the callback object is passed
      instead. "domain" is the object passed to createAsyncListener() or
      returned from listener().
    
    * callbacks.after(context, domain): Same as before(), except run
      immediately after the callback has run. Except if the callback has
      thrown, in which case this will not be called.
    
    * callbacks.error(domain, error): Called when a callback has thrown.
      Currently the "context" is lost in this case so it's not passed, but
      the "domain" object still is. If the error is properly handled the
      return true to continue program execution. If multiple error handlers
      are queued all will be called, and if any one returns true then the
      error is assumed to have been handled.
    
    In the case of callbacks, they are only allowed to throw two levels
    deep. Afterwards the error handler will always return false. This is to
    prevent infinite recursive throws.
    
    As you'll see, the domain module still exists. Full support has been
    added in it's previous form until a complete solution is patched. The
    goal is to have the domain module use AsyncListeners and be as far
    removed from core as possible. When that day comes, I'll fully enjoy
    torching every last line of integrated code until it's all burnt
    stubble.
    trevnorris committed Oct 17, 2013
    Copy the full SHA
    5a95e3c View commit details
    Browse the repository at this point in the history
  3. async-wrap: integrate with WeakObject

    Making WeakObject inherit from AsyncWrap allows us to peak into almost
    all the MakeCallback calls in Node internals.
    trevnorris committed Oct 17, 2013
    Copy the full SHA
    96bb671 View commit details
    Browse the repository at this point in the history
  4. async-wrap: add prototype methods to udp/tcp/pipe

    Now it's possible to add/remove an async listener to an individual
    handle created by UDP, TCP or Pipe.
    trevnorris committed Oct 17, 2013
    Copy the full SHA
    95aa99b View commit details
    Browse the repository at this point in the history
  5. crypto: make RandomBytesRequest a class

    Since RandomBytesRequest make a call to MakeCallback, I needed it to be
    a class so AsyncWrap could handle any async listeners.
    
    Also added a simple test for an issue had during implementation where
    the memory was being released and returned.
    trevnorris committed Oct 17, 2013
    Copy the full SHA
    a47195d View commit details
    Browse the repository at this point in the history
  6. crypto: convert pbkdf2_req to a class

    pbkdf2_req has been renamed to PBKDF2Request and converted to a class.
    It now uses AsyncWrap::MakeCallback.
    
    Also includes, using env()->ondone_string() instead of "ondone" and
    using malloc instead of new char[].
    trevnorris committed Oct 17, 2013
    Copy the full SHA
    704a8e4 View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    861bc74 View commit details
    Browse the repository at this point in the history
  8. timers: add/remove listener after creation

    To accomplish the after callback running in a setInterval, when
    clearInterval was run within the callback, the method is run inside a
    process.nextTick.
    trevnorris committed Oct 17, 2013
    Copy the full SHA
    17d9773 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    e84013f View commit details
    Browse the repository at this point in the history
  10. domain: remove domain code from src/

    Much of domain functionality can be achieved by async listeners, so they
    have been refactored to use them.
    
    There are two cases (one in net.js and other in _http_client.js) where
    the handle isn't created until after the instantiation of the event. So
    it was necessary to add a check if domains exist, then attach the
    domain's listener to the handle at time of creation.
    
    Because the async listener handles errors at the point of asynchronous
    entry, the need to enter/exit a domain in the event emitter was no
    longer needed.
    trevnorris committed Oct 17, 2013
    Copy the full SHA
    e222ec9 View commit details
    Browse the repository at this point in the history
  11. doc: add some info about AsyncListeners

    More information and some examples are necessary.
    trevnorris committed Oct 17, 2013
    Copy the full SHA
    f07f2c0 View commit details
    Browse the repository at this point in the history
  12. Copy the full SHA
    889af6a View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2013

  1. Copy the full SHA
    efb9b4a View commit details
    Browse the repository at this point in the history
  2. weak-object: Dispose() on self

    Also included assert on AsyncWrap that makes sure that
    persistent().IsEmpty().
    trevnorris committed Oct 18, 2013
    Copy the full SHA
    9d48025 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2013

  1. SQUASH: fix indutny review

    trevnorris committed Oct 21, 2013
    Copy the full SHA
    5c59c31 View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2013

  1. Copy the full SHA
    970c975 View commit details
    Browse the repository at this point in the history
  2. test: add async listener tests

    groundwater authored and trevnorris committed Oct 22, 2013
    Copy the full SHA
    bd64774 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2013

  1. SQUASH: fix errorHandler so exit event fires

    And some other misc stuff that'll need to be squashed.
    trevnorris committed Oct 23, 2013
    Copy the full SHA
    a18b1a0 View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2013

  1. Copy the full SHA
    3090248 View commit details
    Browse the repository at this point in the history