Theory behind the processes from LibreOffice Online

Hi,

I’ve read the README document on WSD folder (https://gerrit.libreoffice.org/gitweb?p=online.git;a=blob;f=wsd/README) and I’ve tried to understand the architecture of this software but I’m having many difficulties to understand some concepts. In this document, they talk about 3 processes LOOLWSD, LOOLForKit and LOOLKit.

Ok, LoolWSD is a top-level server that is already listening the public port and waiting a connection of client (I think that is the principal function of this process. It’s look like an easy concept). When a client is connected it spawn a Forkit (I can’t understand the concept of ForKit). The ForKit, in turn, “forking Kit instance”(??? - I don’t understand this - So, the ForKit create a copy of code to implement new tasks according the user is change the document? That is it? ). There is only one ForKit per WSD instance (Why? I’m a client, so I establish a connection to the server, than I want to open 2 documents. The connection is the same but will be necessary to ForKit process, no?) and there is one Kit instance per document.

And the Kit process? what’s represent?

 257 Architecture
 258 ------------
 260 There are three processes: LoolWSD, LoolForKit, and LoolKit.
 262 WSD is the top-level server and is intended to run as a service.
 263 It is responsible for spawning ForKit and listening on public
 264 port for client connections.
 266 The ForKit is only responsible for forking Kit instances. There is
 267 only one ForKit per WSD instance and there is one Kit instance per
 268 document.
 270 WSD listens on a public port and using internal pipes requests
 271 the ForKit to fire a child (Kit) instance to host documents.
272 The ForKit then has to find an existing Kit that hosts that
273 document, based on the public URI as unique key, and forward
274 the request to this existing Kit, which then loads a new
275 view to the document.
277 There is a singleton Admin class that gets notified of all the
278 important changes and update the AdminModel object accordingly.
279 AdminModel object has subscribers which corresponds to admin
280 panel sessions. Subscriber can subscribe to specific commands
281 to get live notifications about, and to update the UI accordingly.
283 Whether a document is loaded for the first time, or this is
 284 a new view on an existing one, the Kit connects via a socket
285 to WSD on an internal port. WSD acts as a bridge between
286 the client and Kit by tunnelling the traffic between the two
287 sockets (that which is between the client and WSD and the one
288 between WSD and Kit).

I’m a noob in this area and these questions can look like stupid but I really need to understand this concepts, so it’ll very helpful if someone could clarify this questions for me or try to explain in an easier way.

Thanks in advance.

I don’t know how this works, but the English seems a bit messed up a few places. First, I think it might read better w/ an extra comma: “…and using internal pipes**,** requests the ForKit…”. Also if “there is one Kit instance per document”, then it should probably be, "ForKit to fire a child (Kit) instance to host a document. (i.e. singular). Also I think “update” needs to be plural, like this: “gets notified of all the important changes, and updates the AdminModel object …”

This is NOT an answer to your question. Rather, it’s me also trying to understand it. I think the quote was probably written by a non-native English speaker doing their best. it might read better with a few changes suggested below, but please take all of this as only food for thought, and not as fact of how it is. If anyone can improve this, please jump in.


WSD = Web Socket Daemon.
For = Fork, as in: a new process that is the child of the parent process.
Kit = is a mystery to me. It might be a software development kit, or a set of tools, or perhaps this.


263...
- It is responsible for spawning ForKit and listening on public port for client connections.
+ It is responsible for spawning ForKit and listening on a public port for client connections.

270...
- WSD listens on a public port and using internal pipes requests the ForKit to fire a child
- (Kit) instance to host documents.

+ The WSD listens on a public port.  It uses internal pipes.  It requests that ForKit fire to 
+ create a child instance (a Kit) to a host document.

In other words, if “there is one Kit instance per document”, then it should probably be a document.

277...
- There is a singleton Admin class that gets notified of all the important changes and 
- update the AdminModel object accordingly.

+ There is a singleton Admin class that gets notified of all the important changes.  
+ It then updates the AdminModel object accordingly.

279...
- AdminModel object has subscribers which corresponds to admin panel sessions.

+ The AdminModel object has subscribers.  Each subscriber corresponds to an admin panel session.

280...
- Subscriber can subscribe to specific commands to get live notifications about, 
- and to update the UI accordingly.

+ To receive live user interface (UI) notifications a subscriber can subscribe to specific 
+ commands.  This is also how a subscriber updates the user interface.

283...
- Whether a document is loaded for the first time, or this is a new view on an existing one, 
- the Kit connects via a socket to WSD on an internal port. 
+ Whether a document is loaded for the first time, or this is a new view on an existing document,
+ the Kit connects via a socket to WSD on an internal port. 

285...
- WSD acts as a bridge between the client and Kit by tunnelling [sic] the traffic between the 
- two sockets (that which is between the client and WSD and the one between WSD and Kit).
+ The WSD acts as a bridge between the client and Kit by tunneling the traffic between the 
+ two sockets.  
+
+ The first  socket is provided by the WSD for the client to use.  (???)  
+ The second socket is provided by the WSD for the Kit    to use.  (???)

Thanks for your reply. Your alterations help me to understand better some quotes but this explanation about how the processes interact with which other is confused for me yet.
Maybe this document (README) has the information too compressed to clarify someone that don’t know well this application.
It’ll really help for me if someone could share some documentation with an explanation with more detail.

What’s a LibreOfficeKit?