Skip to content

Latest commit

 

History

History
135 lines (85 loc) · 6.6 KB

README.md

File metadata and controls

135 lines (85 loc) · 6.6 KB

🦂 scorpio: Client application to test lorax concurrency features

A B A B A B Go Reference Go report Coverage Status Scorpio Continuous Integration pre-commit A B

🔰 Introduction

This project will be used as an additional test aid of the currency features of lorax outside of the scope the unit tests that it already contains.

📚 Usage

Worker Pool Pipeline

From user provided flags, the pool command submits a stream of jobs to the worker pool for concurrent execution. The job is defined as a function which takes a name and emits a greeting to this recipient. Since this function does not represent real work and therefore takes next to no time to run, it is infused with a synthetic delay to simulate real work. The delay is currently defined as a random interval.

  • ▶️ Producer(jobsChSize, stopAfter) => jobsCh: generates a workload

📌 Variables:

Name Flag Unit Description
jobsChSize jobq Capacity of the jobs channel
stopAfter after seconds Stops the producer after this time period
  • ▶️ Pool(noOfWorkers, jobsCh) => resultsCh: handles the workload with multiple workers generating a result stream

📌 Variables:

Name Flag Unit Description
noOfWorkers now No of workers in pool
  • ▶️ Consumer(resultsChSize, resultsCh): consumes the result stream

📌 Variables:

Name Flag Unit Description
resultsChSize resq Capacity of the results channel

⚡ Invocation:

scorpio pool --after 3 --now 5 --jobq 18 --resq 16

🎀 Features

🔨 Developer Info

☑️ Github changes

Some general project settings are indicated as follows:

General

Under Pull Requests

  • Allow merge commits 🔳 DISABLE
  • Allow squash merging 🔳 DISABLE
  • Allow rebase mergingENABLE

Branch Protection Rules

Under Protect matching branches

  • Require a pull request before mergingENABLE
  • Require linear historyENABLE
  • Do not allow bypassing the above settingsENABLE

☑️ Code coverage

  • coveralls.io: add scorpio project

🌐 l10n Translations

This template has been setup to support localisation. The default language is en-GB with support for en-US. There is a translation file for en-US defined as i18n/deploy/scorpio.active.en-US.json. This is the initial translation for en-US that should be deployed with the app.

Make sure that the go-i18n package has been installed so that it can be invoked as cli, see go-i18n for installation instructions.

To maintain localisation of the application, the user must take care to implement all steps to ensure translate-ability of all user facing messages. Whenever there is a need to add/change user facing messages including error messages, to maintain this state, the user must:

  • define template struct (xxxTemplData) in i18n/messages.go and corresponding Message() method. All messages are defined here in the same location, simplifying the message extraction process as all extractable strings occur at the same place. Please see go-i18n for all translation/pluralisation options and other regional sensitive content.

For more detailed workflow instructions relating to i18n, please see i18n README

🧪 Quick Test

To check the app is working (as opposed to running the unit tests), build and deploy:

task tbd

(which performs a test, build then deploy)

NB: the deploy task has been set up for windows by default, but can be changed at will.

Check that the executable and the US language file scorpio.active.en-US.json have both been deployed. Then invoke the pool command with something like

scorpio pool -now 5 --job 18 --resq 16