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

Remove all AsyncListener JS code #8110

Closed
wants to merge 9 commits into from
Closed

Remove all AsyncListener JS code #8110

wants to merge 9 commits into from

Commits on Dec 5, 2014

  1. src: remove async listener

    Async listener will have minor reimplementation in a future commit in
    the form of hooks for user implemented API. Though for simplicity of
    testing it's being completely removed first.
    
    PR-URL: #8110
    trevnorris committed Dec 5, 2014
    Configuration menu
    Copy the full SHA
    62eb806 View commit details
    Browse the repository at this point in the history
  2. async-wrap: move MakeCallback to .cc

    MakeCallback is too large a function to have as an inline. Correct that
    by moving it to a .cc file.
    
    PR-URL: #8110
    trevnorris committed Dec 5, 2014
    Configuration menu
    Copy the full SHA
    0c7ab97 View commit details
    Browse the repository at this point in the history
  3. node, async-wrap: remove MakeDomainCallback

    A lot of code duplication for the removal of a single if statement is
    not worth the added code complexity.
    
    Also fixed using v8::Value::As<T>() before verifying the type of the
    Value. Casting to an incorrect type will cause V8 to abort in debug
    mode.
    
    PR-URL: #8110
    trevnorris committed Dec 5, 2014
    Configuration menu
    Copy the full SHA
    e8dea22 View commit details
    Browse the repository at this point in the history
  4. node: fix throws before timer module is loaded

    An edge case could occur when the setImmediate() in _fatalException()
    would fire before the timers module had been loaded globally and cause
    Node to crash.
    
    PR-URL: #8110
    trevnorris committed Dec 5, 2014
    Configuration menu
    Copy the full SHA
    dd7d161 View commit details
    Browse the repository at this point in the history
  5. src: all wrap's now use actual FunctionTemplate

    Instead of just creating a new Object to contain the connection
    information, instantiate a new instance of a FunctionTemplate. This will
    allow future improvements for debugging and performance probes.
    
    Additionally class providers have been clarified such that the
    "provider" field in req_wrap.h is no longer optional.
    
    PR-URL: #8110
    trevnorris committed Dec 5, 2014
    Configuration menu
    Copy the full SHA
    6a91f1f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    71d6fbc View commit details
    Browse the repository at this point in the history
  7. async-wrap: expose async-wrap as binding

    Expose basic hooks for AsyncWrap via the async_wrap binding. Right now
    only the PROVIDER types are exposed. This is a preliminary step before
    more functionality is added.
    
    PR-URL: #8110
    trevnorris committed Dec 5, 2014
    Configuration menu
    Copy the full SHA
    f53c3c9 View commit details
    Browse the repository at this point in the history
  8. async-wrap: explicitly pass parent

    When instantiating a new AsyncWrap allow the parent AsyncWrap to be
    passed. This is useful for cases like TCP incoming connections, so the
    connection can be tied to the server receiving the connection.
    
    Because the current architecture instantiates the *Wrap inside a
    v8::FunctionCallback, the parent pointer is currently wrapped inside a
    new v8::External every time and passed as an argument. A future
    optimization would be to add the v8::External as the data field when
    creating the v8::FunctionTemplate, change the pointer just before making
    the call then NULL'ing it out afterwards. Though this will only knock
    off an estimated 80ns, and the added code complexity is high. So not
    worth doing until the current approach is proven to be a bottleneck.
    
    PR-URL: #8110
    trevnorris committed Dec 5, 2014
    Configuration menu
    Copy the full SHA
    ec0846d View commit details
    Browse the repository at this point in the history
  9. async-wrap: add event hooks

    Call a user-defined callback at specific points in the lifetime of an
    asynchronous event. Which are on instantiation, just before/after the
    callback has been run. If the error callback also throws an exception
    there will be no mercy and the application will be forced to shutdown.
    
    Currently these only tie into AsyncWrap, meaning no call to a hook
    callback will be made for timers or process.nextTick() events. Though
    those will be added in a future commit.
    
    Here are a few notes on how to make the hooks work:
    
    - The "this" of all event hook callbacks is the request object.
    - The zero field (kCallInitHook) of the flags object passed to
      setupHooks() must be set != 0 before the init callback will be called.
    - In the "init" callback the property "_asyncQueue" must be attached to
      the request object. e.g.
    
      function initHook() {
        this._asyncQueue = {};
      }
    
    - DO NOT inspect the properties of the object in the init callback.
      Since the object is in the middle of being instantiated there are some
      cases when a getter is not complete, and doing so will cause Node to
      crash.
    
    PR-URL: #8110
    trevnorris committed Dec 5, 2014
    Configuration menu
    Copy the full SHA
    174a82e View commit details
    Browse the repository at this point in the history