[Service][Reland] Apply node worker for standalone model 35/245635/7
authorDongHyun Song <dh81.song@samsung.com>
Tue, 13 Oct 2020 10:03:27 +0000 (19:03 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Wed, 21 Oct 2020 05:51:11 +0000 (14:51 +0900)
commitbc1291eeb6f7ae34a867faf97b04e01ed05e1233
tree476d43735ec91bdfa21cd84c7382695fe5c826ff
parent7981937a02b9f40f63877d8a1c512a685fcb99a9
[Service][Reland] Apply node worker for standalone model

This patch includes below,

 1) unify source code with global model.
 2) isolate v8 variable scope from main thread.
   - standalone service application cannot get main global variable.
     of service_manaer / service_runner
 3) refactor handling message with node worker.
 4) refactor termination sequence of node worker more gracefully.
   - process.exit() is invoked by worker side
   - parent handles on('exit') for clean-up

Additionally, there is no noticeable memory increase with node worker.

References:
  https://review.tizen.org/gerrit/244938/
  https://review.tizen.org/gerrit/245591/

Change-Id: Ie9c17b373a69585ca755e39c4ab56243406821a2
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
wrt_app/common/service_manager.ts
wrt_app/common/service_runner.ts
wrt_app/service/builtins/wasm_builder.ts
wrt_app/service/main.ts