Merge lp:~marcustomlinson/unity-js-scopes/lp-1527622 into lp:unity-js-scopes

Proposed by Marcus Tomlinson
Status: Merged
Approved by: Marcus Tomlinson
Approved revision: 121
Merged at revision: 121
Proposed branch: lp:~marcustomlinson/unity-js-scopes/lp-1527622
Merge into: lp:unity-js-scopes
Diff against target: 65 lines (+13/-1)
5 files modified
src/bindings/CMakeLists.txt (+1/-0)
src/bindings/index.js (+4/-0)
src/bindings/src/addon.cc (+2/-1)
src/bindings/src/scope.cc (+5/-0)
src/bindings/src/scope.h (+1/-0)
To merge this branch: bzr merge lp:~marcustomlinson/unity-js-scopes/lp-1527622
Reviewer Review Type Date Requested Status
Alexandre Abreu (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+280963@code.launchpad.net

Commit message

Stop the scopes runtime and exit gracefully upon SIGTERM

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

LGTM

review: Approve
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

> LGTM

Thanks for the review. Top approving.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/bindings/CMakeLists.txt'
--- src/bindings/CMakeLists.txt 2015-11-13 08:28:39 +0000
+++ src/bindings/CMakeLists.txt 2015-12-18 14:28:56 +0000
@@ -24,6 +24,7 @@
24 ./src/*.h24 ./src/*.h
25 ./src/*.cc25 ./src/*.cc
26 ./lib/*.js26 ./lib/*.js
27 ./*.js
27 )28 )
2829
29add_definitions(30add_definitions(
3031
=== modified file 'src/bindings/index.js'
--- src/bindings/index.js 2015-10-28 18:46:50 +0000
+++ src/bindings/index.js 2015-12-18 14:28:56 +0000
@@ -224,3 +224,7 @@
224 return self;224 return self;
225 },225 },
226 });226 });
227
228process.on('SIGTERM', function() {
229 self._scope_binding.stop();
230});
227231
=== modified file 'src/bindings/src/addon.cc'
--- src/bindings/src/addon.cc 2015-12-09 07:22:06 +0000
+++ src/bindings/src/addon.cc 2015-12-18 14:28:56 +0000
@@ -119,7 +119,8 @@
119 js_scope119 js_scope
120 .add_method("scope_base", &JavascriptScopeRuntime::scope_base)120 .add_method("scope_base", &JavascriptScopeRuntime::scope_base)
121 .add_method("scope_config", &JavascriptScopeRuntime::scope_config)121 .add_method("scope_config", &JavascriptScopeRuntime::scope_config)
122 .add_method("run", &JavascriptScopeRuntime::run);122 .add_method("run", &JavascriptScopeRuntime::run)
123 .add_method("stop", &JavascriptScopeRuntime::stop);
123124
124 v8cpp::Class<ScopeBase> scope_base(isolate);125 v8cpp::Class<ScopeBase> scope_base(isolate);
125 scope_base126 scope_base
126127
=== modified file 'src/bindings/src/scope.cc'
--- src/bindings/src/scope.cc 2015-08-25 09:40:42 +0000
+++ src/bindings/src/scope.cc 2015-12-18 14:28:56 +0000
@@ -99,6 +99,11 @@
99 }, nullptr);99 }, nullptr);
100}100}
101101
102void JavascriptScopeRuntime::stop()
103{
104 runtime_->destroy();
105}
106
102std::string JavascriptScopeRuntime::scope_config() const {107std::string JavascriptScopeRuntime::scope_config() const {
103 return scope_config_;108 return scope_config_;
104}109}
105110
=== modified file 'src/bindings/src/scope.h'
--- src/bindings/src/scope.h 2015-08-25 09:40:42 +0000
+++ src/bindings/src/scope.h 2015-12-18 14:28:56 +0000
@@ -38,6 +38,7 @@
3838
39 ScopeBase* scope_base();39 ScopeBase* scope_base();
40 void run(const std::string& scope_config);40 void run(const std::string& scope_config);
41 void stop();
41 std::string scope_config() const;42 std::string scope_config() const;
4243
43 private:44 private:

Subscribers

People subscribed via source and target branches

to all changes: