Next-gen Embark features
Go to file
Pascal Precht 64d8fa3368
feat(core/processManager): introduce `processes:stop` handlers
So far, `ProcessManager` was able to only register a `process:launch` handler.
There was no way to tell `ProcessManager` how to stop processes. This hasn't
been a problem so far as most of the service processes can be started without the usage
of the `ProcessManager`, but turns out to be necessary if we want Embark UI to be able
to pick up running services.

A good example is the webserver process, which until now bypasses the `ProcessManager`
all together. The webserver sets up two event handlers to start and stop it respectively:

```
this.events.setCommandHandler('start-webserver', () => this.server.start());
this.events.setCommandHandler('stop-webserver', () => this.server.stop());
```

In the future, this should happen through the `ProcessManager` instead, so the webserver
process can be picked up by Embark UI, like this:

```
this.request('process:register', 'webserver', () => {
  this.server.start();
});

// and then

this.request('process:launch', 'webserver', () => {
  // server started
});
```

Notice that the given callback to registering a process is actually the function that
gets called to launch the process.

Having that in mind, and considering that we also need a way to stop the process through
`ProcessManager, so we don't introduce a regression, we need a way to register a stop
call back as well.

The new API introduced in this commit looks like this:

```
this.request('process:register', 'webserver', {
  launchFn: (callback) => { this.server.start(callback) },
  stopFn: (callback) => this.server.stop(callback) }
});

// and then

this.request('process:launch', 'webserver', (err, message, port) => {
  // server started
});

this.request('process:stop', 'webserver', err => {
  // server stopped
});
```

Notice that `process:register` works exactly the same way as before as well.

Another thing to notice is that all parameters emitted by the underlying process
are propagated to the outside caller, which is why `err`, `message` and `port` are
available inside the launch callback.
2018-10-23 10:57:05 +02:00
.github Update PULL_REQUEST_TEMPLATE.md 2018-09-11 13:38:40 -04:00
bin remove --no-shim cli option 2018-10-22 19:43:16 +02:00
cmd Minor PR comments 2018-10-23 10:57:05 +02:00
embark-ui Use process log ids 2018-10-23 10:57:05 +02:00
lib feat(core/processManager): introduce `processes:stop` handlers 2018-10-23 10:57:05 +02:00
locales Add support for Parity 2018-10-22 19:53:49 +02:00
templates Fix start without webserver 2018-10-23 10:44:14 +02:00
test conflict in specialconfigs 2018-10-22 19:54:46 +02:00
test_apps move dashboard api into dashboard module 2018-10-23 10:21:37 +02:00
.codeclimate.yml move demo and boilerplate to a templates folder 2018-03-29 19:23:24 -04:00
.editorconfig Add editor config 2018-10-22 19:25:16 +02:00
.eslintignore fix eslint on EVERYTHING 2018-10-23 10:26:14 +02:00
.eslintrc.json make linter happ-ier 2018-10-23 10:27:41 +02:00
.gitignore .gitignore -- demo artifact 2018-10-22 19:39:26 +02:00
.npmignore add test_apps/ & test/ to npmignore 2018-09-26 19:32:15 -04:00
.npmrc save-exact by default 2018-09-20 14:51:03 -05:00
.nycrc update code coverage condig 2016-10-22 21:02:11 -04:00
.travis.yml Merge pull request #892 from embark-framework/features/travis-node-current 2018-09-21 18:28:15 -04:00
CONTRIBUTING.md a good start on a contrib.md 2017-03-10 12:11:54 +09:00
LICENSE add license 2015-07-10 20:41:45 -04:00
README.md fix badges 2018-10-22 19:25:15 +02:00
appveyor.yml test node current release (10) in addition to node LTS release (8) 2018-09-21 17:22:35 -05:00
header.png Update header 2018-09-27 10:23:03 -04:00
logo.png add logo 2017-10-10 07:01:27 -04:00
package-lock.json added date-and-time-package 2018-10-23 10:53:00 +02:00
package.json added date-and-time-package 2018-10-23 10:53:00 +02:00

README.md

Embark

npm Gitter Build Status Build status Open PRs Closed PRs GitHub commit activity the past week, 4 weeks, year

What is Embark

Embark is a framework that allows you to easily develop and deploy Decentralized Applications (DApps).

A Decentralized Application is a serverless html5 application that uses one or more decentralized technologies.

Embark currently integrates with EVM blockchains (Ethereum), Decentralized Storages (IPFS), and Decentralized communication platforms (Whisper and Orbit). Swarm is supported for deployment.

With Embark you can:

Blockchain (Ethereum)

  • Automatically deploy contracts and make them available in your JS code. Embark watches for changes, and if you update a contract, Embark will automatically redeploy the contracts (if needed) and the dapp.
  • Contracts are available in JS with Promises.
  • Do Test Driven Development with Contracts using Javascript.
  • Keep track of deployed contracts; deploy only when truly needed.
  • Manage different chains (e.g testnet, private net, livenet)
  • Easily manage complex systems of interdependent contracts.

Decentralized Storage (IPFS)

  • Easily Store & Retrieve Data on the DApp through EmbarkJS. Including uploading and retrieving files.
  • Deploy the full application to IPFS or Swarm.

Decentralized Communication (Whisper, Orbit)

  • Easily send/receive messages through channels in P2P through Whisper or Orbit.

Web Technologies

  • Integrate with any web technology including React, Foundation, etc..
  • Use any build pipeline or tool you wish, including grunt, gulp and webpack.
$ npm -g install embark

See Complete Documentation.