Skip to content

Add support for python workers #103

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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