A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/AdaCore/spawn below:

GitHub - AdaCore/spawn

This library provides simple API to spawn processes and communicate with them. We provide two implementations of the same API - the integrated into Glib event loop and the independent.

Run alr get --build spawn or alr get --build spawn_glib.

Also you can build from the cloned repository directory with

For spawn_glib do this in packages/glib subdirectory:

cd packages/glib
alr build

Clone repository or unpack source archive, then run

make all install PREFIX=/path/to/install
  1. Add with "spawn"; or with "spawn_glib"; to your project file.
  2. Create a process object:
    P : Spawn.Processes.Process;
  3. Assign program name
    P.Set_Program ("/bin/bash");
  4. (Optional) Assign command line arguments, working directory, environments variables.
  5. Assign an event listener
    P.Set_Listener (L'Unchecked_Access);
  6. Start the process:
  7. (Glib independent case) With no event loop integration you should drive it by you-self periodically calling
    Spawn.Processes.Monitor_Loop (1);

The listener will get these events:

See an example in the spawn test

Next diagram shows process states and emited events during its life:

You should NOT finalize process object until it in Not_Running state.

AdaCore

Feel free to dive in! Open an issue or submit PRs.

Apache-2.0 © AdaCore


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4