Skip to content

Commit 0f8d730

Browse files
timarandrasGabriel Schulhof
authored andcommitted
doc: fix syntax error in example
Add override specifier to virtual functions. PR-URL: #650 Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent 4e88506 commit 0f8d730

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/async_worker.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ The code below shows a basic example of `Napi::AsyncWorker` the implementation:
371371
#include <chrono>
372372
#include <thread>
373373

374-
use namespace Napi;
374+
using namespace Napi;
375375

376376
class EchoWorker : public AsyncWorker {
377377
public:
@@ -380,12 +380,12 @@ class EchoWorker : public AsyncWorker {
380380

381381
~EchoWorker() {}
382382
// This code will be executed on the worker thread
383-
void Execute() {
383+
void Execute() override {
384384
// Need to simulate cpu heavy task
385385
std::this_thread::sleep_for(std::chrono::seconds(1));
386386
}
387387

388-
void OnOK() {
388+
void OnOK() override {
389389
HandleScope scope(Env());
390390
Callback().Call({Env().Null(), String::New(Env(), echo)});
391391
}

0 commit comments

Comments
 (0)