LiveSync.Replication (live_sync v0.1.0-beta.2)

Most of this code was sourced from https://github.com/josevalim/sync.

Summary

Functions

Returns a specification to start this module under a supervisor.

Use to emulate a disconnection from the database.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

disconnect(name)

Use to emulate a disconnection from the database.

start_link(opts)

subscribe(name)

wait_for_connection!(name, timeout \\ 5000)

Wait for connection.

This is typically used by boot to make sure the replication is running to avoid unnecessary syncs. It accepts a maximum timeout.

This function will exit if the server is not running. It returns :ok or :timeout otherwise.