jessejanderson
Creating a calendar in OTP
I’ve been reading Lance Halvorsen’s new beta book “Functional Web Development with Elixir, OTP and Phoenix” and it’s got me thinking about new ways of using processes.
In the book, you build a battleship-clone, and the gameboard you build is built with coordinates - each of which is its own process. The advantage you get out of this is that each coordinate is independent yet can hold it’s own state, and also a coordinate exists independent of any sort of heirarchy. Since it is just a process, it can be a part of different branches of data and easily read / updated.
I was wondering if it would be possible to do the same sort of thing with a calendar app. Each date could be a process that stores the events/times happening that day, one advantage being that you could potentially check for room conflicts when creating a new weekly event that just calls up the processes associated with the dates you are scheduling to check for any potential conflicts.
Obviously, one huge issue with this thought process is timezones - so maybe it’s an entirely wrong-headed approach.
My work currently has several calendar apps built in Rails and finding/resolving conflicts is one of the biggest sluggishness factors - so that is definitely one factor that I’m trying to find a solution for.
Just sort of spinning this stuff around in my head and wondering if anyone has any thoughts or ideas for a way to take advantage of OTP in a scheduling/calendar app. ![]()
Most Liked
DianaOlympos
Well if you can translate both to a timestamp, then Range would work as it takes integer ![]()
lance
I’d just like to say that this is exactly what I had hoped for when I began writing the book. <3
dom
Why is finding conflicts sluggish in the Rails app?
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








