Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new Concept Exercise: genserver #559

Closed
angelikatyborska opened this issue Jan 28, 2021 · 0 comments · Fixed by #1076
Closed

Implement new Concept Exercise: genserver #559

angelikatyborska opened this issue Jan 28, 2021 · 0 comments · Fixed by #1076
Assignees
Labels
concept-exercise Adding or improving a concept exercise help wanted 🤝 v3 Related to Exercism v3 x:action/create Work on something from scratch x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/concept-exercise Work on Concept Exercises x:size/large Large amount of work x:type/content Work on content (e.g. exercises, concepts)

Comments

@angelikatyborska
Copy link
Member

angelikatyborska commented Jan 28, 2021

Getting started

Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:

Goal

The student should understand the GenServer behaviour and know how to use it, writing a public module API and implementing the behaviour's callbacks.

Learning objectives

  • Know about the GenServer behaviour and its callbacks.
  • Know that the name stands for "generic server".
  • Understand the difference between handle_call, handle_cast, and handle_info.
  • Understand the possible return values of the callbacks.
  • Know it's a good idea to have a catch-all handle_info to avoid an ever-growing process inbox.
  • Know that GenServers usually expose an easy-to-use public API instead of expecting its users to call GenServer.call themselves.
  • Know when not to use GenServer (if Agent is good enough, if there is no need to keep state)

Out of scope

  • process linking, monitoring, :DOWN messages
  • process registry, process names

Concepts

  • genserver

Prerequisites

  • atoms
  • tuples
  • processes
  • pid
  • agent (it will be easier to understand after having learned about agents)
  • use (as in use GenServer)
  • behaviours

Practice exercises

Those practice exercises should have genserver in their prerequisites:

  • bank-account
  • react

Resources to refer to

Story

It might be a good idea to either duplicate or come up with a continuation of the stories used for the processes exercise (take-a-number machine) or the agent exercise (community garden). Ideally the story would force the student to use all three types of callbacks.

Analyzer

The analyzer should check that indeed a module using the GenServer behaviour was implemented, and not a generic receive loop or an Agent.

Help

If you have any questions while implementing the exercise, please post the questions as comments in this issue.

@angelikatyborska angelikatyborska added concept-exercise Adding or improving a concept exercise v3 Related to Exercism v3 labels Jan 30, 2021
@angelikatyborska angelikatyborska added x:action/create Work on something from scratch x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/concept Work on Concepts x:module/concept-exercise Work on Concept Exercises x:size/massive Massive amount of work x:type/content Work on content (e.g. exercises, concepts) x:size/large Large amount of work and removed x:module/concept Work on Concepts x:size/massive Massive amount of work labels Jun 11, 2021
@angelikatyborska angelikatyborska changed the title [v3] Implement new Concept Exercise: genserver Implement new Concept Exercise: genserver Sep 28, 2021
@angelikatyborska angelikatyborska self-assigned this Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concept-exercise Adding or improving a concept exercise help wanted 🤝 v3 Related to Exercism v3 x:action/create Work on something from scratch x:knowledge/intermediate Quite a bit of Exercism knowledge required x:module/concept-exercise Work on Concept Exercises x:size/large Large amount of work x:type/content Work on content (e.g. exercises, concepts)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant