> Every page of the ganymede website is listed in https://eugo.io/docs/ganymede/llms.txt.

# Ray Core

> Ray Core in ganymede. Tasks, actors, objects and scheduling.

Web page: https://eugo.io/docs/ganymede/ray_patterns/core/

Tasks, actors, objects and scheduling.

This section holds 14 notebooks from [`ray_patterns/core/`](https://github.com/eugo-inc/ganymede/tree/main/ray_patterns/core) in the ganymede repository. Each page shows the notebook as committed; the links under a page's title download the `.ipynb` or open it on GitHub.

## Notebooks

- [Map and reduce with remote tasks](https://eugo.io/docs/ganymede/ray_patterns/core/01_map-reduce/): Two mapper tasks run in parallel and a reducer task combines their results.
- [Stateful actor: a parameter server](https://eugo.io/docs/ganymede/ray_patterns/core/02_parameter-server/): An actor keeps state between calls. One node creates the ParameterServer actor and a second node calls its set method.
- [Fan out one task per list item](https://eugo.io/docs/ganymede/ray_patterns/core/03_map-over-list/): A single node launches one remote task per element of a list and gathers all results with one ray.get.
- [Distributed queue between a producer and a consumer](https://eugo.io/docs/ganymede/ray_patterns/core/04_queue-producer-consumer/): A ray.util.queue.Queue connects a remote producer task to a remote consumer task. The builder writes both tasks for you.
- [Task resources, retries and scheduling options](https://eugo.io/docs/ganymede/ray_patterns/core/05_task-options/): Per-call .options(): CPU and memory requests, automatic retries on application errors, a task name for the dashboard, the SPREAD scheduling strategy and a…
- [Multiple return values and streaming generators](https://eugo.io/docs/ganymede/ray_patterns/core/06_multiple-returns-and-streaming/): One task returns two separate ObjectRefs (num_returns=2); another is a generator whose values stream back one by one (num_returns=“streaming”).
- [Take the first results with ray.wait](https://eugo.io/docs/ganymede/ray_patterns/core/07_wait-first-ready/): Three tasks with different run times feed a Wait node. ray.wait returns as soon as two are done, leaving the slow one running.
- [Cancel a running task](https://eugo.io/docs/ganymede/ray_patterns/core/08_cancel-task/): A long-running task is cancelled with ray.cancel. Getting its result afterwards raises TaskCancelledError.
- [Share one object with ray.put](https://eugo.io/docs/ganymede/ray_patterns/core/09_put-shared-object/): A Put node stores a value in the object store once; two tasks receive the same ObjectRef instead of each getting their own copy.
- [Named actor: create, look up, call and kill](https://eugo.io/docs/ganymede/ray_patterns/core/10_named-actor-lifecycle/): A detached actor is registered under a name, looked up again with ray.get_actor, called, and finally removed with ray.kill.
- [Reserve resources with a placement group](https://eugo.io/docs/ganymede/ray_patterns/core/11_placement-group/): A placement group reserves two one-CPU bundles. Each task is pinned to a bundle, and the group is removed at the end.
- [Actor with concurrency groups](https://eugo.io/docs/ganymede/ray_patterns/core/12_actor-concurrency-groups/): The builder writes an actor class whose methods run in separate concurrency groups: up to four I/O calls at once, compute calls one at a time.
- [Graph inputs as notebook parameters](https://eugo.io/docs/ganymede/ray_patterns/core/13_input-parameters/): Input nodes become typed variables at the top of the code. In the multi-cell layout they land in one cell tagged parameters, so papermill can override them.
- [Lazy DAG with bind() and InputNode](https://eugo.io/docs/ganymede/ray_patterns/core/14_bind-dag-inputs/): The same graph style in bind mode: .bind() builds a lazy Ray DAG around an InputNode, and execute(x=5) runs it with a concrete input.
