renatoaguimaraes / golang-job-scheduler Goto Github PK
View Code? Open in Web Editor NEWJob worker service that provides an API to run arbitrary Linux processes.
License: MIT License
Job worker service that provides an API to run arbitrary Linux processes.
License: MIT License
The library (Worker) is a reusable Golang package that interacts with Linux OS to execute arbitrary processes (Jobs). The Worker is responsible for the business logic to start, stop processes, stream the process output, and handle process errors.
syntax = "proto3";
option go_package = "goteleport.com/worker/pb";
message StartRequest {
string name = 1;
repeated string args = 2;
}
message StartResponse {
string jobID = 1;
}
message StopRequest {
string jobID = 1;
}
message StopResponse {
}
message QueryRequest {
string jobID = 1;
}
message QueryResponse {
int32 pid = 1;
int32 exitCode = 2;
bool exited = 3;
}
message StreamRequest {
string jobID = 1;
}
message StreamResponse {
string output = 1;
}
service WorkerService {
rpc Start(StartRequest) returns (StartResponse);
rpc Stop(StopRequest) returns (StopResponse);
rpc Query(QueryRequest) returns (QueryResponse);
rpc Stream(StreamRequest) returns (stream StreamResponse);
}
Client to provide communication between the user and Worker Library through the gRPC API.
$ ./worker-client ls -lha
Job 46305a32-a2d6-11eb-bcbc-0242ac130002 was created.
$ ./worker-client query 46305a32-a2d6-11eb-bcbc-0242ac130002
pid: 1324 ExitCode: 1 Exited: false
$ ./worker-client stream 46305a32-a2d6-11eb-bcbc-0242ac130002
total 0
drwxr-xr-x 2 renatoguimaraes staff 64B Apr 22 12:38 .
drwxrwxr-x@ 54 renatoguimaraes staff 1.7K Apr 22 12:38 ..
$ ./worker-client stop 46305a32-a2d6-11eb-bcbc-0242ac130002
Job not found
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.