> > > * A class than inherits from JsonWebsocketConsumer > That is what I started to do.
> * That class' receive() method decodes incoming messages, finds a handler > function, and then calls that, taking the value it returns and sending it > over the reply channel > My thoughts as well. Also RPC protocol must implement "results" but also "errors" which I plan to implement by catching exceptions. > * The user of it would then subclass again and implement JSON-RPC methods > either as methods on the class itself, or using a dict in the class body to > map names of methods to callables (your call on that one) > I was thinking about creating a decorator @channel_rpc for the methods. Those would take either their "name" or an optional argument passed to the decorator. > > The non-delivery thing mentioned is the alternative you'd want, here, too > - the alternative to non-guaranteed delivery (at most once) is > guaranteed-and-possible-duplicate delivery (at least once), which for RPC > systems generally isn't good - in RPC, it's easy to detect if a call didn't > work as you won't get a response within a certain timeout. > > I am not sure to understand. In which case can there be messages/frames lost?! Where does that happen? Between the server interface and the Django layer? I would need to know more about that... Otherwise I might need to move with uWSGI or something.... JSON-RPC in itself doesn't implement a timeout, althought the javascript client better have one... > Andrew > > On Tue, Jan 24, 2017 at 8:39 AM, Fabien Millerand <mill...@gmail.com > <javascript:>> wrote: > >> alexander, I uploaded some ideas. >> >> I think our best call is to extend WebsocketConsumer with some basic >> Json-RPC rules. I reused some code from this module: >> https://pypi.python.org/pypi/jsonrpc2 >> >> See jsonrpc_test branch on repo. If we wrap it up nicely it should be >> fairly easy. >> >> The last step is to create a decorator for the consumer's method so it >> can send back the "Method Not Found" error if needed. >> >> Andrew, if you have some ideas or input on that, it would be much >> appreciated. >> >> Cheers, >> Fabien >> >> >> Le mardi 24 janvier 2017 11:24:35 UTC+1, Fabien Millerand a écrit : >>> >>> I just read that on the "Docs": >>> >>> On*e thing channels do not do, however, is guarantee delivery. If you >>>> need certainty that tasks will complete, use a system designed for this >>>> with retries and persistence (e.g. Celery), or alternatively make a >>>> management command that checks for completion and re-submits a message to >>>> the channel if nothing is completed (rolling your own retry logic, >>>> essentially).* >>> >>> >>> >>> .... >>> >>> >>> Le mardi 24 janvier 2017 09:41:41 UTC+1, Alexander Prokhorov a écrit : >>>> >>>> My github name is “prokher”. Would be happy to help. >>>> >>>> вторник, 24 января 2017 г., 11:00:06 UTC+3 пользователь Fabien >>>> Millerand написал: >>>>> >>>>> Hi, >>>>> >>>>> I will start implementing something this week (starting today). >>>>> I will let you know how things go. >>>>> Alexander, I would be happy to share my work and get some >>>>> feedback/help on this project. Let me know your github username and we >>>>> can >>>>> colaborate >>>>> >>>>> Cheers >>>>> Fab >>>>> >>>>> Le dimanche 22 janvier 2017 15:18:03 UTC+1, Alexander Prokhorov a >>>>> écrit : >>>>>> >>>>>> If you are going to implement JSON-RPC based on Channels, I would be >>>>>> happy to participate, I suppose we will start doing this in a few week >>>>>> anyway. >>>>>> >>>>>> пятница, 20 января 2017 г., 13:36:49 UTC+3 пользователь Fabien >>>>>> Millerand написал: >>>>>>> >>>>>>> Thanks a lot for your answer Andrew. >>>>>>> >>>>>>> On a side note, would you be related to Mike Godwin? I just draw >>>>>>> some moustaches on Trump's face 5 minutes before seeing your message... >>>>>>> It >>>>>>> is disturbing... >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> Le jeudi 19 janvier 2017 19:27:10 UTC+1, Andrew Godwin a écrit : >>>>>>>> >>>>>>>> I haven't seen anything like that personally, but I also don't see >>>>>>>> all of the Channels stuff going on, so maybe there is one. >>>>>>>> >>>>>>>> It would be relatively easy to implement as a single class-based >>>>>>>> consumer that dispatches to RPC handlers based on method name, though, >>>>>>>> as >>>>>>>> it matches the consumer pattern very well. >>>>>>>> >>>>>>>> Andrew >>>>>>>> >>>>>>>> On Thu, Jan 19, 2017 at 7:34 AM, Fabien Millerand < >>>>>>>> mill...@gmail.com> wrote: >>>>>>>> >>>>>>>>> Hi everyone, >>>>>>>>> >>>>>>>>> I am looking to implement a websocket server based on Django using >>>>>>>>> JSON-RPC protocol. >>>>>>>>> >>>>>>>>> I have been looking around for a pre-made solution without >>>>>>>>> success. I am also a newbie in Django so I am a little bit lost... >>>>>>>>> >>>>>>>>> Did anyone try to develop something like that? >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> You received this message because you are subscribed to the Google >>>>>>>>> Groups "Django users" group. >>>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>>> send an email to django-users...@googlegroups.com. >>>>>>>>> To post to this group, send email to django...@googlegroups.com. >>>>>>>>> Visit this group at https://groups.google.com/group/django-users. >>>>>>>>> To view this discussion on the web visit >>>>>>>>> https://groups.google.com/d/msgid/django-users/f8fdc9b4-ef54-4e39-ad66-9f5b4d9eb042%40googlegroups.com >>>>>>>>> >>>>>>>>> <https://groups.google.com/d/msgid/django-users/f8fdc9b4-ef54-4e39-ad66-9f5b4d9eb042%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>>>> . >>>>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>>>> >>>>>>>> >>>>>>>> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users...@googlegroups.com <javascript:>. >> To post to this group, send email to django...@googlegroups.com >> <javascript:>. >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/f52130e1-4ec4-48b7-b903-cadf22fb6d70%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/f52130e1-4ec4-48b7-b903-cadf22fb6d70%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e2992ea1-691c-4d50-b268-67a060acf73a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.