Created
June 15, 2019 22:22
-
-
Save deepal/dcc45d39f172902a41bfa35edcb39587 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Constructor of Async resource | |
| AsyncResource::AsyncResource(Isolate* isolate, | |
| Local<Object> resource, | |
| const char* name, | |
| async_id trigger_async_id) | |
| : env_(Environment::GetCurrent(isolate)), | |
| resource_(isolate, resource) { | |
| async_context_ = EmitAsyncInit(isolate, resource, name, | |
| trigger_async_id); | |
| } | |
| // Destructor of Async resource | |
| AsyncResource::~AsyncResource() { | |
| EmitAsyncDestroy(env_, async_context_); | |
| resource_.Reset(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment