Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

[Elixir] Implement new Concept Exercise: genserver #2328

Closed
angelikatyborska opened this issue Oct 14, 2020 · 1 comment
Closed

[Elixir] Implement new Concept Exercise: genserver #2328

angelikatyborska opened this issue Oct 14, 2020 · 1 comment
Labels
status/help-wanted Extra attention is needed track/elixir type/new-exercise Add a new exercise

Comments

@angelikatyborska
Copy link
Member

angelikatyborska commented Oct 14, 2020

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:

Please also watch the following video:

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

Resources to refer to

Story

Look through existing stories (/reference/stories/) to find inspiration or an existing story that can work for this exercise. 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 status/help-wanted Extra attention is needed type/new-exercise Add a new exercise track/elixir labels Oct 14, 2020
@angelikatyborska
Copy link
Member Author

Migrated to the Elixir track repo: exercism/elixir#559

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/help-wanted Extra attention is needed track/elixir type/new-exercise Add a new exercise
Projects
None yet
Development

No branches or pull requests

1 participant