{"get", key} do send(from, Map.get(store, key)) else if message == {"insert", key, value} do new_store = Map.put(store, key, value) send(from, "ok") end end end reference = spawn run(%{}) send(reference, {"insert", "Green Day", ["Dookie"]}) send(reference, {"get", "Green Day", ["Dookie"]}) # ["Dookie"] run(new_store) run(store)