bank

package module
v0.0.0-...-5ab0d4e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Bank was meant to set a concurrency design challenge. As it turned out, locking and contention were quite easily avoided by judicious placement of data on the channels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Datagen

func Datagen()

Datagen generates and routes the transactions.

func Run

func Run(results chan Result)

Start the processing, wait for it to finish, and send the results via channel to the driver program.

func Teller

func Teller(work chan txn)

The teller has the task of updating the customerr balance.

Types

type Result

type Result struct {
	Custnum int64
	Balance int64
	Calcbal int64
}

Result describes the final data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL