Skip to content

Commit

Permalink
use AsyncLocalStorage instead of our home-grown solutions
Browse files Browse the repository at this point in the history
The comment in the file that selected a storage implementation suggested
just using AsyncLocalStorage once it supports triggerAsyncResource().
That said, literally zero of our code uses triggerAsyncResource(), so
this is assumed to be historical and no longer relevant.

Switching to stock AsyncLocalStorage will enable the usage of
TracingChannel in the future.
  • Loading branch information
bengl committed Oct 4, 2024
1 parent bba5f3d commit ed4975f
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 303 deletions.
4 changes: 2 additions & 2 deletions packages/datadog-core/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const LocalStorage = require('./src/storage')
const { AsyncLocalStorage } = require('async_hooks')

const storage = new LocalStorage()
const storage = new AsyncLocalStorage()

module.exports = { storage }
108 changes: 0 additions & 108 deletions packages/datadog-core/src/storage/async_resource.js

This file was deleted.

5 changes: 0 additions & 5 deletions packages/datadog-core/src/storage/index.js

This file was deleted.

8 changes: 0 additions & 8 deletions packages/datadog-core/test/setup.js

This file was deleted.

20 changes: 0 additions & 20 deletions packages/datadog-core/test/storage/async_resource.spec.js

This file was deleted.

160 changes: 0 additions & 160 deletions packages/datadog-core/test/storage/test.js

This file was deleted.

0 comments on commit ed4975f

Please sign in to comment.