Skip to content

Commit

Permalink
Update livebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jessestimpson committed Oct 20, 2024
1 parent 8609fef commit 09b0869
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion notebooks/guide.livemd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```elixir
Mix.install([
{:ecto_foundationdb, "~> 0.1"}
{:ecto_foundationdb, "~> 0.3"}
])
```

Expand Down
11 changes: 5 additions & 6 deletions notebooks/watches.livemd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
```elixir
Mix.install([
{:phoenix_playground, "~> 0.1.0"},
{:ecto_foundationdb, git: "https://github.com/foundationdb-beam/ecto_foundationdb", branch: "main"}
{:ecto_foundationdb, "~> 0.3"}
])
```

Expand Down Expand Up @@ -212,9 +212,8 @@ ChangeFavoriteQuote.to(
tenant,
"Duke Leto Atreides",
"""
Give as few orders as possible. \
Once you've given orders on a subject, \
you must always give orders on that subject.
Once you have explored a fear, it becomes less terrifying. \
Part of courage comes from extending our knowledge.
""")
```

Expand All @@ -224,6 +223,6 @@ ChangeFavoriteQuote.to(tenant, "Captain America", "I can do this all day.")

## Takeaways

It's true that the behavior that our webpage exhibits is standard LiveView real-time updating. In real Phoenix applications, this is commonly done via `Phoenix.PubSub`, and it works great.
The behavior that our webpage exhibits is standard LiveView real-time updating. In real Phoenix applications, this is commonly done via `Phoenix.PubSub`. There are many advantages to using PubSub, but in this demo we replaced it with a feature from FDB.

The main takeaway I hope you see in this Livebook is that we've done the same real-time updating via the database directly, without any dispatcher. Doing so allows your PubSub to focus on higher-level application behavior instead of slinging data objects.
The main takeaway from this Livebook is that there is no dispatcher. Each process of our application can choose to register a watch, and it will be notified directly as needed.

0 comments on commit 09b0869

Please sign in to comment.