Giter VIP home page Giter VIP logo

Comments (5)

pavlov99 avatar pavlov99 commented on June 19, 2024

@solorab , let me take a look.

There is a question: Why do you need this method? Could you provide use case? May be it is possible to use json-rpc notification for that.

from json-rpc.

kmyk avatar kmyk commented on June 19, 2024

I want to support putting ids to requests to call methods written to listen notification.
When I write a function for notification and a client sends a request with id, I want to return a valid response to the request. I don't like to return nothing to client (forbidden by the specification) nor add a line to return a dummy result explicitly.

from json-rpc.

pavlov99 avatar pavlov99 commented on June 19, 2024

I see. If you send id within request, current implementation does not support None response. As I get you right, you need to notify server from the client side (to call methods written to listen notification).
If you omit ids for request (either explicitly from client, or via passing is_notification=True to Request constructor) then you send notification. Notification does not require any response from dispatcher function, so, you could use "return None".
If notification function is executed correctly, server sends 200 Response, if there are exceptions raised during notification, response would have error in the body. Basically, if something returned, then there are errors.

@solorab, does it work for you?

from json-rpc.

kmyk avatar kmyk commented on June 19, 2024

I am writing an application which works with plugins through TCP. So It cannot return returncodes and I want to accept requests widely.
Please excuse me adding information later.

from json-rpc.

pavlov99 avatar pavlov99 commented on June 19, 2024

Information was not added to the issue, closed as outdated.

from json-rpc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.