Skip to content

Instantly share code, notes, and snippets.

View jasongoodwin's full-sized avatar

Jason Goodwin jasongoodwin

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jasongoodwin on github.
  • I am jasongoodwin (https://keybase.io/jasongoodwin) on keybase.
  • I have a public key ASCoW0mBFXZcqxjffgX-HYufPDj_SUIkQNclZlLEVbAUlAo

To claim this, I am signing this object:

echo hello world
@jasongoodwin
jasongoodwin / ddd elixir presentation - jason goodwin
Created December 3, 2018 21:46
presentation from Toronto elixir meetup.
theme: Fira, 3
# Domain Driven Design (DDD) with Elixir
- jason@funnelcloud.io
- (we're hiring)
---
# Intent
- give an introduction to DDD conceps
- design
- architecture
- *HEURISTICS*
@jasongoodwin
jasongoodwin / gist:b6aa964ecfa230b53dc3562d85376819
Created April 24, 2018 13:46
Functional Programming Paradigms - "Monadic"-style data processing in elixir
theme: Sketchnote, 7
build-lists: false
slidenumbers: true
autoscale: true
---
# Functional Programming Paradigms In Elixir
- Objectives:
- Understand functional programming a bit better
defmodule LoggingFake do
@moduledoc """
This server is a Fake.
It will log the messages received.
Helpful stub of a genserver.
"""
use GenServer
require Logger
def handle_call(msg, _from, state) do
@jasongoodwin
jasongoodwin / gist:fcbb575580406e6b0beb5496f8aaab63
Created November 29, 2017 15:49
Elixir Meetup - Slides - Jason Goodwin - Nov2017
---
# Functional Programming Paradigms In Elixir
- Objectives:
- Understand functional programming a bit better
- Categorize and understand approaches
- See which approaches fit which problems
- Map concepts and approaches from Scala/Haskell to elixir
---
package contexts.cart.cluster;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.CoordinatedShutdown;
import akka.actor.Props;
import akka.cluster.sharding.ClusterSharding;
import akka.cluster.sharding.ClusterShardingSettings;
import akka.cluster.sharding.ShardRegion;
import akka.event.Logging;
package contexts.cart.cluster;
import akka.actor.PoisonPill;
import akka.actor.ReceiveTimeout;
import akka.cluster.sharding.ShardRegion;
import akka.japi.pf.ReceiveBuilder;
import akka.persistence.AbstractPersistentActor;
import contexts.cart.api.CartItem;
import scala.PartialFunction;
import scala.concurrent.duration.Duration;
@jasongoodwin
jasongoodwin / gist:40e90bbb329243176988
Last active January 24, 2022 19:48
Akka CircuitBreaker Example
package com.akkademy
import akka.actor._
import akka.event.Logging
import akka.pattern.{CircuitBreaker, ask}
import akka.util.Timeout
import com.akkademy.sapi.{GetRequest, KeyNotFoundException, SetRequest}
import scala.collection.mutable.HashMap
import scala.concurrent.Await
@jasongoodwin
jasongoodwin / gist:7156238
Last active December 26, 2015 13:09
Demonstrates changing the default Stop supervision behaviour on a top level actor encountering an exception/error during initialization (above /user guardian actor). Demonstrates how exceptions are thrown out of akka extensions as well (they throw like any other class).
import akka.actor._
import akka.actor.SupervisorStrategy._
import akka.routing.RoundRobinRouter
object Main {
val system = ActorSystem("TestActorSystem")
val escalator = OneForOneStrategy() {
case e: ActorInitializationException ⇒
println("Got exception during actor start: " + e)