# README
go-exercises-worker
Background worker of the service for solving programming exercises.
Features
- interaction with queues:
- common properties:
- automatic declaring of the used queues;
- passing of a message data in JSON;
- operations:
- consuming of the solutions:
- concurrent handling;
- once requeue the solution on failure;
- producing of the solution results:
- generating of the custom message ID;
- consuming of the solutions:
- common properties:
- solution runners:
- solution runner based on the github.com/thewizardplusplus/go-code-runner package:
- loading of the allowed imports from an outer configuration;
- canceling by a timeout:
- code compiling;
- code execution;
- solution runner based on the github.com/thewizardplusplus/go-code-runner package:
- tools:
- script for generating the allowed import configuration.
Installation
Prepare the directory:
$ mkdir --parents "$(go env GOPATH)/src/github.com/thewizardplusplus/"
$ cd "$(go env GOPATH)/src/github.com/thewizardplusplus/"
Clone this repository:
$ git clone https://github.com/thewizardplusplus/go-exercises-worker.git
$ cd go-exercises-worker
Install dependencies with the dep tool:
$ dep ensure -vendor-only
Build the project:
$ go install ./...
Usage
$ go-exercises-backend
Environment variables:
ALLOWED_IMPORT_CONFIG
— path to the allowed import config (default:./configs/allowed_imports.json
);RUNNING_TIMEOUT
— maximal duration of solution running (default:10s
);- message broker:
SOLUTION_CONSUMER_CONCURRENCY
— amount of solution consumer threads (default:1000
).
API Description
API description in the AsyncAPI format: docs/async_api.yaml.
License
The MIT License (MIT)
Copyright © 2021-2022 thewizardplusplus