eclipse-uprotocol / eclipse-uprotocol/up-cpp

Publisher constructor limits all messages to a single payload type

Open
#236 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
29
Forks
33
PR merge metrics
No merged PRs in 30d

Description

The Publisher constructor takes the expectedPayloadFormat as a constructor value and forces all messages to be of the same payload type. I think it would make sense to allow the payloadformat to either not be specified in the constructor, or use the UNSPECIFIED value as a "all payload formats accepted".

I'm working on the example programs for up-cpp, and I tried to send the exact same data in 2 different payload formats (TEXT & RAW - just to add to the example usage) and the code threw and exception because the expectedPayload didn't match the payload I tried to publish. So if I want to send 2 different types of payloads, I'd have to duplicate a lot of code, instead of simply publishing 2 different payloads.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.