Skip to content

snivilised/scorpio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ¦‚ 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 merging βœ… ENABLE

Branch Protection Rules

Under Protect matching branches

  • Require a pull request before merging βœ… ENABLE
  • Require linear history βœ… ENABLE
  • Do not allow bypassing the above settings βœ… ENABLE

β˜‘οΈ 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

About

πŸ¦‚ lorax worker pool client test app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages