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

Proposed by Marcus Tomlinson on 2015-12-18
Status: Merged
Approved by: Marcus Tomlinson on 2016-01-07
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) 2015-12-18 Approve on 2016-01-05
PS Jenkins bot (community) continuous-integration Approve on 2015-12-18
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.
Alexandre Abreu (abreu-alexandre) wrote :

LGTM

review: Approve
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
1=== modified file 'src/bindings/CMakeLists.txt'
2--- src/bindings/CMakeLists.txt 2015-11-13 08:28:39 +0000
3+++ src/bindings/CMakeLists.txt 2015-12-18 14:28:56 +0000
4@@ -24,6 +24,7 @@
5 ./src/*.h
6 ./src/*.cc
7 ./lib/*.js
8+ ./*.js
9 )
10
11 add_definitions(
12
13=== modified file 'src/bindings/index.js'
14--- src/bindings/index.js 2015-10-28 18:46:50 +0000
15+++ src/bindings/index.js 2015-12-18 14:28:56 +0000
16@@ -224,3 +224,7 @@
17 return self;
18 },
19 });
20+
21+process.on('SIGTERM', function() {
22+ self._scope_binding.stop();
23+});
24
25=== modified file 'src/bindings/src/addon.cc'
26--- src/bindings/src/addon.cc 2015-12-09 07:22:06 +0000
27+++ src/bindings/src/addon.cc 2015-12-18 14:28:56 +0000
28@@ -119,7 +119,8 @@
29 js_scope
30 .add_method("scope_base", &JavascriptScopeRuntime::scope_base)
31 .add_method("scope_config", &JavascriptScopeRuntime::scope_config)
32- .add_method("run", &JavascriptScopeRuntime::run);
33+ .add_method("run", &JavascriptScopeRuntime::run)
34+ .add_method("stop", &JavascriptScopeRuntime::stop);
35
36 v8cpp::Class<ScopeBase> scope_base(isolate);
37 scope_base
38
39=== modified file 'src/bindings/src/scope.cc'
40--- src/bindings/src/scope.cc 2015-08-25 09:40:42 +0000
41+++ src/bindings/src/scope.cc 2015-12-18 14:28:56 +0000
42@@ -99,6 +99,11 @@
43 }, nullptr);
44 }
45
46+void JavascriptScopeRuntime::stop()
47+{
48+ runtime_->destroy();
49+}
50+
51 std::string JavascriptScopeRuntime::scope_config() const {
52 return scope_config_;
53 }
54
55=== modified file 'src/bindings/src/scope.h'
56--- src/bindings/src/scope.h 2015-08-25 09:40:42 +0000
57+++ src/bindings/src/scope.h 2015-12-18 14:28:56 +0000
58@@ -38,6 +38,7 @@
59
60 ScopeBase* scope_base();
61 void run(const std::string& scope_config);
62+ void stop();
63 std::string scope_config() const;
64
65 private:

Subscribers

People subscribed via source and target branches

to all changes: