From 1185fdb258fcba8acd9d66054e3b1ba9a055c83d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Troels=20Br=C3=B8dsgaard?=
Date: Sat, 13 Jan 2018 21:36:55 +0100
Subject: [PATCH] Improve documentation for Phoenix.Tracker (#93)
---
lib/phoenix/tracker.ex | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/phoenix/tracker.ex b/lib/phoenix/tracker.ex
index 92daca8a0..555f11f84 100644
--- a/lib/phoenix/tracker.ex
+++ b/lib/phoenix/tracker.ex
@@ -21,12 +21,12 @@ defmodule Phoenix.Tracker do
## Optional `server_opts`:
- * `broadcast_period` - The interval in milliseconds to send delta broadcats
+ * `broadcast_period` - The interval in milliseconds to send delta broadcast
across the cluster. Default `1500`
* `max_silent_periods` - The max integer of broadcast periods for which no
- delta broadcasts have been sent. Defaults `10` (15s heartbeat)
+ delta broadcasts have been sent. Default `10` (15s heartbeat)
* `down_period` - The interval in milliseconds to flag a replica
- as down temporarily down. Default `broadcast_period * max_silent_periods * 2`
+ as temporarily down. Default `broadcast_period * max_silent_periods * 2`
(30s down detection). Note: This must be at least 2x the `broadcast_period`.
* `permdown_period` - The interval in milliseconds to flag a replica
as permanently down, and discard its state.
@@ -165,6 +165,9 @@ defmodule Phoenix.Tracker do
* `pid` - The Pid being tracked
* `topic` - The `Phoenix.PubSub` topic to update for this presence
* `key` - The key identifying this presence
+ * `meta` - Either a new map of metadata to attach to this presence,
+ or a function. The function will receive the current metadata as
+ input and the return value will be used as the new metadata
## Examples