<commit_before>.. _worker_protocol:

===========================
The Worker Message Protocol
===========================

.. note:: This protocol is used by a :term:`worker` in Disco.
          You don't need to write your own worker to run a :term:`job`,
          you can usually use the standard :mod:`disco.worker`.

A :term:`worker` is an executable that can run a task, given by the
Disco :term:`master`.  The executable could either be a binary
executable, or a script that launches other executables.  In order to
be usable as a Disco worker, an executable needs to implement the
:ref:`worker_protocol`.

There are two parts to using a binary executable as a Disco worker.
The first part is the submission of the executable to the Disco master.
The second part is the interaction of the executable with its
execution environment, when running a :term:`task`.

This document describes how the worker should communicate with
Disco, while it is executing.  For more on creating and submitting
the :term:`job pack`, see :ref:`jobpack`.

.. note:: The same executable is launched to perform :term:`map` and
          :term:`reduce` tasks.
<commit_msg>docs: update a doc title<commit_after>.. _worker_protocol:

=========================
The Disco Worker Protocol
=========================

.. note:: This protocol is used by a :term:`worker` in Disco.
          You don't need to write your own worker to run a :term:`job`,
          you can usually use the standard :mod:`disco.worker`.

A :term:`worker` is an executable that can run a task, given by the
Disco :term:`master`.  The executable could either be a binary
executable, or a script that launches other executables.  In order to
be usable as a Disco worker, an executable needs to implement the
:ref:`worker_protocol`.

There are two parts to using a binary executable as a Disco worker.
The first part is the submission of the executable to the Disco master.
The second part is the interaction of the executable with its
execution environment, when running a :term:`task`.

This document describes how the worker should communicate with
Disco, while it is executing.  For more on creating and submitting
the :term:`job pack`, see :ref:`jobpack`.

.. note:: The same executable is launched to perform :term:`map` and
          :term:`reduce` tasks.

{'fraction_non_alphanumeric': 0.11284046692607004, 'fraction_numerical': 0.0, 'mean_word_length': 4.153674832962138, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4584693', 'n_tokens_mistral': 607, 'n_tokens_neox': 572, 'n_words': 326}