Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bilgili
Copy link
Contributor

@bilgili bilgili commented Apr 13, 2016

It is not complete yet but has the idea. I am still debugging. FYI @eile.

zeq/event.cpp Outdated
servus::Serializable::Data Event::_toBinary() const
{
servus::Serializable::Data data;
data.ptr.reset( _impl->getData(), []( const void* ){});
Copy link
Contributor Author

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 ).

zeq::Event echoEvent( ::zeq::vocabulary::EVENT_ECHO,
std::bind( &Subscriber::onEchoEvent,
this,
std::placeholders::_1 ));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use lambda?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@bilgili
Copy link
Contributor Author

bilgili commented Apr 18, 2016

@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 ));
Copy link
Contributor

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

Copy link
Contributor Author

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 :)

@eile
Copy link
Contributor

eile commented Apr 18, 2016

Are we renaming the zeroeq::Event ?

Probably. Best I could come up would be zeroeq::FlatBuffer. FB should also become an optional dependency.

@bilgili
Copy link
Contributor Author

bilgili commented Apr 18, 2016

I would keep the Event name and move to FBEvent ?

@bilgili
Copy link
Contributor Author

bilgili commented Apr 20, 2016

  • "FB should also become an optional dependency."

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 ?

@eile
Copy link
Contributor

eile commented Apr 20, 2016

I would keep the Event name and move to FBEvent ?

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.

@eile
Copy link
Contributor

eile commented Apr 20, 2016

optional dependency

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).

@bilgili
Copy link
Contributor Author

bilgili commented Apr 20, 2016

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 ?

@eile
Copy link
Contributor

eile commented Apr 20, 2016

On 20. Apr 2016, at 17:32, Ahmet Bilgili [email protected] wrote:

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 ?

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 );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why renamed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXIT event is removed

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chevtche closed #153 without merging. On the other hand, if it's removed, then you have to remove the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which function ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it :)

@hernando
Copy link

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.

@bilgili
Copy link
Contributor Author

bilgili commented Apr 25, 2016

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.

@hernando
Copy link

#152 will still be needed.

@bilgili
Copy link
Contributor Author

bilgili commented Apr 25, 2016

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.

@hernando
Copy link

I'm not sure I understand what you mean.

@bilgili
Copy link
Contributor Author

bilgili commented Apr 25, 2016

retest this please

1 similar comment
@bilgili
Copy link
Contributor Author

bilgili commented Apr 25, 2016

retest this please

@bilgili
Copy link
Contributor Author

bilgili commented Apr 25, 2016

@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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm 'the'

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm

@bilgili bilgili assigned rdumusc and unassigned eile May 18, 2016
zmq_msg_close( &msg );
}
}
zmq_msg_t msg;
Copy link

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

@rdumusc
Copy link

rdumusc commented May 18, 2016

I'm giving a +1 since this has already been extensively reviewed, but I don't understand every details.

@bilgili bilgili merged commit 6de9a8a into HBPVIS:master May 18, 2016
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.

4 participants