particle4dev / komodo-rpc-lib

Komodo RPC Library for modern JavaScript
MIT License
4 stars 3 forks source link

add an option to spawn an instance #20

Closed pbca26 closed 5 years ago

pbca26 commented 5 years ago

Title: [Persona name] should (not) be able to [overarching action]

Business/User Value: As [persona] I want to [action by user] so that [value or need met]

Acceptance Criteria GIVEN [necessary context and preconditions for story] WHEN [action] THEN [reaction]

DEV NOTES can you also add spawn? via function arg or something https://github.com/KomodoPlatform/Agama/blob/master/routes/api/daemonControl.js#L238 it's good for debugging/dev when you need to restart an app multiple times running native

DESIGN Notes None

---other items that you may add to a story---

NEEDS PM None

NEEDS DESIGN None

Related issues https://github.com/particle4dev/komodo-rpc-lib/issues/13 https://github.com/particle4dev/komodo-rpc-lib/issues/22

/label ~"story"

particle4dev commented 5 years ago

@pbca26 Hi In this articles, it said spawn is fit for the long-running application. I think it makes sense so I switch to use spawn by default. Is there any case do you want to use execFile for running komodod?

pbca26 commented 5 years ago

i think it's a good idea don't forget to add detached option for debug purposes

particle4dev commented 5 years ago

@pbca26 Hi just added detached option. Please double-check and let me know if it's good enough for your case.

example: https://github.com/particle4dev/komodo-rpc-lib/blob/master/examples/start-chain-with-detacked-options.js

source: https://github.com/particle4dev/komodo-rpc-lib/blob/master/src/daemon/control.js#L64 https://github.com/particle4dev/komodo-rpc-lib/blob/master/src/daemon/control.js#L73