Skip to content

Instantly share code, notes, and snippets.

@alanpeabody
Last active August 29, 2015 14:21
Show Gist options
  • Save alanpeabody/0846d6966380cc0f6468 to your computer and use it in GitHub Desktop.
Save alanpeabody/0846d6966380cc0f6468 to your computer and use it in GitHub Desktop.
Elixir Workshop Ideas

Brown Bag Beers Elixir Workshop

Goal: Get some hands on time playing with Elixir and OTP.

Things to try (pick one!)

0. Generating a new supervised app with mix.

Covers:

  • mix
  • dependencies
  • apps and default supervisor.

1. Build a parallel map function using processes

MyEnum.pmap/2 should iterate over a list of items, apply the function to each item in it's own process, and return the results in a list.

Covers:

  • Modules
  • Basic Syntax
  • Using processes
  • Testing

2. Build an in memory cache (no expiry).

Cache.get/1 get an item from the cache or return nil Cache.store/2 store a value in the cache at a given key Cache.cache/2 macro to either retreive from cache or store and return value in block.

Covers:

  • OTP Supervisors & GenServers
  • Dict (HashDict)
  • Macros
  • More Testing

3. Build a simple API (leveraging Cache) using Plug directly

Add: GET /v1/cache/:key && POST /v1/cache/:key

Covers:

  • Plug
  • JSON serialization

4. Add Ecto backed models to the API.

Add an ecto model with API access.

Add CRUD for /v1/posts

Covers:

  • Ecto (lots to cover here)

5. Build an API using Relax

6. Build an API using Pheonix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment