Skip to content

Receiver: return bool from receive() to indicate onReceive handler result - #111

Open
Tyagiquamar wants to merge 1 commit into
chronoxor:mainfrom
Tyagiquamar:fix-receiver-receive-bool-return
Open

Tyagiquamar wants to merge 1 commit into
chronoxor:mainfrom
Tyagiquamar:fix-receiver-receive-bool-return

Conversation

@Tyagiquamar

Copy link
Copy Markdown

Fixes #92.

Summary of Changes

  • Updated Receiver::receive() return type from void to bool across protocol headers and implementation (proto/fbe_protocol.h, proto/fbe_protocol.cpp).
  • Updated C++ code generator template in source/generator_cpp.cpp to generate bool-returning receive() methods.
  • Forwarded onReceive() handler boolean return value through receive(), allowing callers to detect message handling failures and malformed payloads.

Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>
@chronoxor

Copy link
Copy Markdown
Owner

Error handling in malformed payloads is a good topic to improve. We cannot just return false in bool receive() because it accumulates buffer in chanks (what now cannot be processed, could with a next portion of data). FBE do in optimistic way assuming with have no malformed internal traffic between services.

I'll think about a good and safe way to recieve any data in Receiver and how to handle error with different strategies:

  • Cancel recieving
  • Reset recieve stream
  • Notify on deserialization errors

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add bool return for receive protocol

2 participants