Comments (3)
Was discussing this with Matthias a bit more. Actually, I think we should not expose pointer types to the user at all, but just take and give plain move-only FairMQMessage
s by value. The same we should imho apply to the FairMQTransportFactory
member functions.
@rbx What do you think?
from fairmq.
What I have in mind now, especially after considering possibility of having our own header and some other discussions we had, is to offer a new fair::mq::Message
class. Which will be:
- move only.
- contain multiple buffers/parts that user can read/write/add/remove (if i'm not mistaken this is similar/same to what you once proposed with multiple buffers).
- will have methods to access header values.
- ... ?
Internally it can be just built out of FairMQParts (which are also move only and non pointer), where one or more parts are reserved for our headers or anything really, since we will not expose internal parts to user.
Regarding what factory returns i am not certain, it indeed can return those move-only types, but then it has to give up ownership.
from fairmq.
This article has a lot of answers on how to implement our interfaces with value semantics: https://akrzemi1.wordpress.com/2012/02/03/value-semantics/
Regarding what factory returns i am not certain, it indeed can return those move-only types, but then it has to give up ownership.
Indeed, I was not telling all the details. After thinking about it, the sockets should have shared ownership on the transport, device also has shared ownership on transport. When we need to communicate something to the sockets, we also need to track (non-owning) pointers to the sockets in the transport. Once a socket is destructed, it will deregister itself from the transport. I believe this would be the cleanest implementation. But there is no rush, let's take the time and think it through another couple of times.
... is to offer a new
fair::mq::Message
class ...
This would be a great migration strategy. If I may rephrase Use the overdue namespacing of some of our classes to introduce a new API in parallel and then deprecate the old API at some point.
from fairmq.
Related Issues (20)
- Decrease severity of channel config/initialize messages during startup HOT 2
- Feature: Index-based channel access from `fair::mq::Device`
- Rework transport interrupt/resume periods
- Unintentional API change in `fair::mq::Parts::operator[](size_type)`
- Add option `--shm-metadata-msg-size`
- Interrupt `fair::mq::Poller::Poll` on `NewStatePending()`
- Boost MSM (< 1.77?) broken in C++20 HOT 1
- Improve `bool ChangeState()` API
- Provide state "traits"
- Add a simple switch to disable built-in control logic
- Support `CITATION.cff`
- Improve error message on invalid channel config after init timeout HOT 1
- Make --shm-monitor default to false
- LeakSanitizer: detected memory leaks
- shmem/UnmanagedRegion.h:279:126: warning: expression result unused [-Wunused-value]
- (Unneeded?) Memory bloat in fair::mq::shmem::Message HOT 11
- Bulk message creation HOT 16
- [Codemeta] 3 fields required by OSSR are missing HOT 2
- Opening shm file fails HOT 13
- Single receive buffer limit for many connected peers for ZMQ connections
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fairmq.