Skip to content

Commit

Permalink
doc: fix syntax error in example
Browse files Browse the repository at this point in the history
Add override specifier to virtual functions.

PR-URL: #650
Reviewed-By: Nicola Del Gobbo <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
timarandras authored and Gabriel Schulhof committed Jan 21, 2020
1 parent 4e88506 commit 0f8d730
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/async_worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ The code below shows a basic example of `Napi::AsyncWorker` the implementation:
#include <chrono>
#include <thread>

use namespace Napi;
using namespace Napi;

class EchoWorker : public AsyncWorker {
public:
Expand All @@ -380,12 +380,12 @@ class EchoWorker : public AsyncWorker {

~EchoWorker() {}
// This code will be executed on the worker thread
void Execute() {
void Execute() override {
// Need to simulate cpu heavy task
std::this_thread::sleep_for(std::chrono::seconds(1));
}

void OnOK() {
void OnOK() override {
HandleScope scope(Env());
Callback().Call({Env().Null(), String::New(Env(), echo)});
}
Expand Down

0 comments on commit 0f8d730

Please sign in to comment.