The Livedata WriteFence

A write fence collects a group of writes and runs its callbacks when all writes are committed.

Good job! That's it for "The Livedata WriteFence."

Need a second look? Watch again

The Livedata WriteFence

A write fence is a cool data structure that collects a group of writes and runs its callbacks when all writes are committed. When we call a Meteor method from a client, the callback function is called when the client receives the "updated" message for the method from the server. The server uses a write fence to make sure that any documents have been written to Mongo and all "changed" messages have been sent to connected clients for those documents before sending the "updated" message to the calling client. In this video, I'll show you how the WriteFence works.

  • Meteor
  • Tutorial
**Related lessons:** * <a href="https://www.eventedmind.com/feed/meteor-how-does-the-client-synchronize-writes-with-the-server" target="_blank">How Does The Client Sync Writes With The Server</a> * <a href="https://www.eventedmind.com/posts/meteor-dynamic-scoping-with-environment-variables" target="_blank">Dynamic Scoping with Environment Variables</a>
Join the Discussion

Want to leave a comment? .