Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Feature Idea: Native async/await support

feature-request
feature-idea
pre-release

#1

Instructions for feature idea replies:

REF: Does the node-newrelic support native async/await (>= 7.6)

Native async/await is supported from Node.js 7.6. And we can use it without babel transforming.

async function findUserInfo(userId) {
  const userInfo = await new Promise((resolve, reject) => {
      this.memcached.get(`${CACHE_PREFIX_VER}:${userId}`, (err, data) => {
        if (err) {
          reject(err);
          return;
        }
        resolve(data);
      });
    });
    // ...
    return userInfo;
}

function asyncWrapper(routeHandler) {
  if (routeHandler.length < 4) {
    return (req, res, next) => routeHandler(req, res, next).catch(next);
  }
  return (err, req, res, next) => routeHandler(err, req, res, next).catch(next);
}

app.get('/:user_id', asyncWrapper(async (req, res) => {
  const userInfo = await findUserInfo(req.params.user_id);
  res.json(userInfo);
});

We have tried to use this feature in out production, and found that newrelic agent doesn’t support it yet.

I’m not familiar with newrelic agent, but I think instrumentation can be implemented by async hook which will be landed on Node.js 8.0.


#2

@kou_hin Thank you for the feature idea/request. We are planning to include support for async/await with our Node 8 support. With respect to async-hooks, you are correct. In fact, we were involved in the discussions that ultimately brought this capability to Node 8.


#3

When do you expect that to be released?


#4

Is there any update or timeline on this feature? Our server is heavily depends on async/await, really looking forward for this feature.


#5

I’m unable to offer a specific date at this time, but async/await support remains high on our priority list and should be available well in advance of Node 8 becoming the active LTS.


#6

This is very good news for us. Thanks for your information.


#7

I have an update on our planned native async/await support in Node 8. We’ve reached the point where we have completed our initial implementation work and are ready to engage with select customers to collect feedback. If this sounds interesting to you, read on…

Our support for async/await is based on the new async_hooks functionality available in Node 8. As such, suitable Beta participants will need to be running Node 8.x. As this is pre-release software, we strongly recommend running it in a non-production environment.

If you qualify and want to help us shape our support for async/await by providing input, please sign up for Beta access here:

Request Beta Access

Once you send the sign up form our way, we will be contacting you via email to get you started.

We look forward to hearing from you—our customers—and learning more about your use cases in order to make this ‘awaited’ feature work for you.


pinned #8