Skip to content
Playground(another site)

bynk.held.unsupported_storage

Error A held value (Connection[F]) is stored in a Set/Log/Cache — held values may only live in Cell[Option[Connection]] or Map[K, Connection] (§2.9.3, real-time track slice 2).

A held value, a Connection[F], is a live handle owned by one place, not data. Only Cell[Option[Connection]] and Map[K, Connection] can hold one: a Set needs value equality, which a connection does not have, and a Log or Cache could retain or evict one without closing it. Keep connections in a Map keyed by something that identifies each, such as a user id, and iterate it with the broadcast operations.

Example

store conns: Set[Connection[ServerFrame]] // ✗ a `Set` cannot hold a connection
store conns: Map[UserId, Connection[ServerFrame]] // ✓ held by key

In the Book

See also

  • Every code in its category, Other, on the diagnostic index.
  • bynk explain bynk.held.unsupported_storage shows the same from the installed toolchain, without a network.