General developer forum

Web sockets and Moodle

Dan at desk in Moodle HQ, Perth
Re: Web sockets and Moodle
Group Core developersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Plugin developersGroup Testers
I've only looked very briefly in the past, but I don't think that websockets are really compatible with the request-based apache-style webserver model which we use currently in Moodle.

They are persistant connections which, to be used effectively, need something non-blocking like node.js for the requests to be served properly.

So, I don't think it can be widely applied to Moodle for some time. It'd be a nice project to convert the old (mostly unmaintained) chat daemon to web-sockets though, that uses that model already.
Average of ratings: -
Gareth J Barnard
Re: Web sockets and Moodle
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Dear Tim and Dan,

Thank you for your response.  I believe that there could be a few PHP web socket libraries out there.  Would be a good project to get as a core API like jQuery and others.  I suppose from an efficiency point of view it all depends on the size and processing time expended on communication with WebSockets against bog standard AJAX over HTTP.

I also see the point Dan of the request based model where you might not know when to terminate a connection when a client leaves.  Food for thought though smile



Average of ratings: -