Skip to content

Add support for python workers #103

@robertmaynard

Description

@robertmaynard

We need the ability to generate a python interface to the worker class.

This would allow remus users to develop workers in python, and hook them up to a c++ application that is submitting the jobs.

I want the python code to look something like the following:

from remus.common import MeshIOType
from remus.meshtypes import Model, Mesh3D
from remus.worker import ServerConnection, Worker, Job
from remus.proto import JobRequirements, JobSubmission, JobContent, JobProgress ,JobStatus, JobResult

conn = ServerConnection()
in_out_type = MeshIOType(Model(),Mesh3D())
w = Worker( JobRequirements( in_out_type, "ExampleWorker", ""), conn)

j = w.getJob()
content = j.details("data")

message = "hello from a python worker"
status = JobStatus(j.id, JobProgress(message) )
w.updateStatus( status )

status.progress = JobProgress(message, 50 )
w.updateStatus(status)

result = JobResult(j.id, "Python worker is now finished")
w.returnMeshResults(result)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions