empty_job()

Executes the generic no-op job krn.EmptyJob on the server.

This job has no logic of its own — all input parameters and files are returned unchanged (echo). Its purpose is to serve as a universal communication channel whose behaviour is defined entirely by server-side Before/After events.

Without configured events, the job acts as an echo: all input parameters and files are returned 1:1 in the response.

1. Signature

  • Sync

  • Async

ecm.system.empty_job(*, files=None, **params) -> JobResult
await ecm.system.empty_job(*, files=None, **params) -> JobResult

2. Parameters

Parameter Type Default Description

files

list[JobRequestFile] | None

None

Optional list of input files to send to the job.

**params

JobValueTypes

 — 

Arbitrary keyword arguments are sent as input parameters to the server and passed to server-side events.

3. Return value

A JobResult object. Access output parameters via result.get(name, …​) and returned files via result.files.

4. Examples

4.1. Echo test

  • Sync

  • Async

result = ecm.system.empty_job(MyParam="Hello World")
print(result.get("MyParam", str))  # "Hello World"
result = await ecm.system.empty_job(MyParam="Hello World")
print(result.get("MyParam", str))  # "Hello World"

4.2. Send and receive files

  • Sync

  • Async

from ecmind_blue_client.rpc import JobRequestFile

file = JobRequestFile(name="test.txt", data=b"Hello")
result = ecm.system.empty_job(files=[file])
print(len(result.files))  # 1
from ecmind_blue_client.rpc import JobRequestFile

file = JobRequestFile(name="test.txt", data=b"Hello")
result = await ecm.system.empty_job(files=[file])
print(len(result.files))  # 1

5. See also