Closed joshuabenuck closed 4 years ago
I have cleaned up the listeners and the logging.
synopsis should reflect edit to first paragraph
is the test that is failing. I have seen it randomly pass, but it mostly fails for me. Looks to be a timing issue of some sort.
This PR builds on https://github.com/fedwiki/wiki/pull/127. As part of the server side initialization of plugins, the server will start a socket.io listener.
Server side events are keyed by
slugItem
(the slug of a page + the id of an item separated by a slash).Clients register their interest in a particular
slugItem
event by sending asubscribe
message to the server. When a client is no longer interested in a particularslugItem
, it should send anunsubscribe
message. A forthcoming PR adds common logic to handle this for clients so they do not have to do this themselves.Server side plugins should emit any event that they want forwarded by using the event emitter that is part of the
params
object passed to thestartServer
callback of their plugin.Note: Plugins will need to use an out of band mechanism to identify the
slugItem
s that require server side processing. This could take the form of a custom URL or a config file. The eventing system does not provide any means for a server side plugin to be notified of the existence of specificslugItem
s.Changes remaining before merge: