Skip to content
Home » Documentation » Starting and stopping

Starting and stopping

Starting Darlean applications

Currently, we support TypeScript with Node.JS for creating actors and running Darlean. We are working hard to also include other languages, where C#/.NET, Python and Go are all very high on our wish list.

A Darlean application can be started by running node with the entry point of your application as argument:

$ node ./lib/index.js

Darlean-specific command line arguments are provided on the command line. By default, they all start with --darlean-.

$ node .lib/index.js --darlean-config=config.json5 --darlean-appid=my-app-02

In particular, the --darlean-config argument can be used to load the remaining configuration from a configuration file, and the —darlean-appid assigns a specific application id to this application.

More information about the configuration of Darlean applications (including command line arguments and environment variables) is in the page about Configuration.

Stopping Darlean applications

Killing on Linux

On Linux, it is possible to gracefully stop Darlean application by means of the kill command. The standard signals SIGINT and SIGTERM are recognized by Darlean, and on receiving them, Darlean gracefully deactivates all actors and then stops running.

When Darlean starts, it creates a ./pid/<appname>.pid file (unless disabled via the configuration). This file contains the process id of the application. This process id can be used to stop the proper instance.

Deleting run-files on Windows and Linux

On Windows, graceful stopping of console applications is poorly supported. Therefore, Darlean uses the mechanism of run-files to allow a graceful stop.

The run-file mechanism is supported on all platforms (so it can also be used on Linux).

When a Darlean application starts, it writes a run file to ./pid/<appname>.run. Like the pid-file, the run-file contains the process-id.

To stop Darlean, simply delete the corresponding run file. Darlean detects the removal, and will start to shutdown gracefully. When it is fully stopped, it also removes the pid file.