Since WAMP is a natural fit for distributed system, it seems natural
to use it to balance big tasks such as video encoding, natural text
processing and such. These tasks material to be processed, often on
the form of a file of hundred of Mo, sometimes more.
You can't really send a 1 Go file with a RPC call, that would bloat
But a streaming protocole such as WebRTC on a async lib screem for
easy data streaming.
Is there a facility to do that ? Could we add this as a primitive ? For exemple, a client declare :
def onjoin(self). def process_file(path, parameters_sent): # do stuff wit the file # if not endpoint is provided,
the data will go throught crossbar
# but you may want to avoir
overloading it and bypass it
self.pipe('video.encoding', endpoint='', process_file)
The client would then do :
And crossbar would send it back the endpoint address, then it would
start sending data the ApplicationSession would process
Once downloaded, the process_file get called with a path to the
temporary file, which will be deleted automatically once the
self.stream would return a promise with then() called if the file is
downloaded, error() if the downloads has been interupted(). onchunk
would provide a hook to process the file chunk while it’s been sent.
A similar param could be available on the server.
I know you can already do it manually using streaming websocket
manually, but having it has a primitive would make things so much
simpler. Sending files between machines is still a pain in 2015. So
much things to deal with : retries, faillure callback, progress