class LavinMQ::Replication::Server
- LavinMQ::Replication::Server
- Reference
- Object
Overview
When a follower connects: It sends a static header (wrong header disconnects the client) It sends its password (servers closes the connection if the password is wrong) Server sends a list of files in its data directory and the sha1 hash of those files Client requests files that is missing or has mismatching checksums of In the meantime the server queues up changes (all publishes/consumes are paused) When client doesn't request more files starts to stream changes Server sends "appends", which include the file path and the bytes to be appended It also sends which files should be deleted or has been rewritten (such as json files) The follower sends back/acknowledges how many bytes it has received
Defined in:
lavinmq/replication/server.crConstant Summary
-
Log =
::Log.for("replication")
Constructors
Instance Method Summary
- #append(path : String, obj)
- #bind(host, port)
- #clear
- #close
- #delete_file(path : String)
- #files_with_hash(& : Tuple(String, Bytes) -> Nil)
- #followers : Array(Follower)
- #handle_socket(socket)
- #listen
- #register_file(file : File)
- #register_file(mfile : MFile)
- #replace_file(path : String)
- #with_file(filename, & : MFile | File | Nil -> Nil) : Nil