-
Notifications
You must be signed in to change notification settings - Fork 24
Event as a servus::Serializable #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
zeq/event.cpp
Outdated
| servus::Serializable::Data Event::_toBinary() const | ||
| { | ||
| servus::Serializable::Data data; | ||
| data.ptr.reset( _impl->getData(), []( const void* ){}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The servus::Data class uses a shared_ptr which is not really used correctly ( all uses are deleting the deleter which is at the end a raw ptr - check ZeroBuf class _toBinary function as well ).
tests/connection/broker.cpp
Outdated
| zeq::Event echoEvent( ::zeq::vocabulary::EVENT_ECHO, | ||
| std::bind( &Subscriber::onEchoEvent, | ||
| this, | ||
| std::placeholders::_1 )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use lambda?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
@eile : Are we renaming the zeroeq::Event ? |
| *_publisher )); | ||
| BOOST_CHECK( subscriber.registerHandler( zeroeq::vocabulary::EVENT_ECHO, | ||
| std::bind( &Subscriber::onEchoEvent, this, std::placeholders::_1 ))); | ||
| zeroeq::Subscriber subscriber( test::buildURI( "127.0.0.1", *_publisher )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for your code: Please adhere to 80c/line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference is, I would not complain :)
Probably. Best I could come up would be |
|
I would keep the Event name and move to FBEvent ? |
Can you please open this a bit ? There are many places that refers to FB in the code ( CMake uses, C++ uses ). We want the FB related part as a separate library ? |
I won't argue, but at this point it is an object (serializable) not an event anymore. Events will come back eventually, I had a first discussion with @chevtche last week but we are far from "done" on this feature. |
I was thinking 'common_find_package(FlatBuffers)' and if/ifdef ZEROEQ_USE_FLATBUFFERS in the appropriate places (probably just the CMakeLists to include the event class if fb available). |
|
Then, for instance Monsteer is depending on ZeroEq, which means in CMake of Monsteer, FLATBUFFERS_FOUND is used ? Or, still there is a way to use ZEROEQ_FLATBUFFERS variables over the place ? |
|
On 20. Apr 2016, at 17:32, Ahmet Bilgili [email protected] wrote:
Monsteer has (and will still need) a "common_find_package(FlatBuffers REQUIRED)”, so no need for conditionals. Cheers, Stefan. |
tests/broker.h
Outdated
| void onExitEvent( const zeroeq::FBEvent& event ) | ||
| { | ||
| BOOST_CHECK_EQUAL( event.getType(), zeroeq::vocabulary::EVENT_EXIT ); | ||
| BOOST_CHECK_EQUAL( event.getType(), zeroeq::vocabulary::EVENT_ECHO ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why renamed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXIT event is removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which function ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got it :)
|
Maybe I'm wrong because I'm late to this discussion, but to me it seems that implementing #152 and then adapting the FB code to use the new API will require less work and produce a better result than adapting the FB to use Serializable. The only thing I'm not sure is whether the current Subscriber::registerHandler would conflict with the proposal from #152. |
|
I started earlier with the idea and I have already moved everything in Monsteer towards it. So, lets merge these first and then lets see if we still need #152. |
|
#152 will still be needed. |
|
If we have a empty serializable event made of "type" I am not sure you need it. I believe we have cleaned the subscriber & publisher API for this reason. |
|
I'm not sure I understand what you mean. |
|
retest this please |
1 similar comment
|
retest this please |
|
@eile: ping, I will commit Monsteer after this is merged. |
doc/Changelog.md
Outdated
|
|
||
| * [145](https://github.com/HBPVIS/ZeroEQ/pull/145): | ||
| * The zeroeq::Event class is renamed to zeroeq::FBEvent | ||
| * zeroeq::FBEvent is derived from the servus::Serializable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm 'the'
zeroeq/detail/fbevent.h
Outdated
| parser.builder_.Clear(); | ||
| // Since we are working on the same copy with new servus::Serializable | ||
| // based Flat Buffer events ( not memory per event ), | ||
| // we are copying the memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
zeroeq/subscriber.cpp
Outdated
| zmq_msg_close( &msg ); | ||
| } | ||
| } | ||
| zmq_msg_t msg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the whole block has been shifted, now it has 3 spaces
|
I'm giving a +1 since this has already been extensively reviewed, but I don't understand every details. |
It is not complete yet but has the idea. I am still debugging. FYI @eile.