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

Refactor my elixir runner #12

Open
evantravers opened this issue Dec 1, 2019 · 0 comments
Open

Refactor my elixir runner #12

evantravers opened this issue Dec 1, 2019 · 0 comments

Comments

@evantravers
Copy link
Owner

Goal: Only build the "world state" once, run both methods on it so that IO is performed only once. I could even run both concurrently I suppose.

Use a Protocol or something where each day has to implement before/1 and p1/1 and p2/1. Running the day/0 method would run the before/1 and then run p1/1 and p2/2 on the state object that is resulting?

I could also consider using an Agent or GenServer to hold the world state? Interesting… I suppose if I can think in a concurrent model that would work. Maybe some simulation where each cell only needs to be aware of its neighbors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant