Looking for constructive feedback on my EventBus implementation

Started by
3 comments, last by ninnghazad 5 years, 10 months ago

Hello there

Some time ago I created EventBus implementation with friends. I used previous and recent implementation in 3-4 games that I was part of.

During this time I receive only feedback from developers that were working with me. Now I would like to get more feedback what do you think and maybe you have some requests/improvements ?

It would be nice to have some opinions from "fresh developers" and more advanced ones.

My main questions: (you don;t have to answer if you don't want to)

- How it generally look ? Is it OK ? ( I mean your first impression, main README)

- Is it easy to use ?

- Does documentation explaining what it needs (in clear way), especially if you didn't previously use event bus pattern.

- What is missing for you ?

- Why you don't want to use it ? (eg. license, minimum C++11, etc.)

- Are you using other implementation, if yes pls mention :)

https://github.com/gelldur/EventBus

 

 

 

Advertisement

It looks fine with a once-over.

This is the type of code that every game builds, and it is simple enough that it is rarely reused. That is the only complaint about it.  It re-invents the wheel, and it is an easy wheel to re-create and customize when needed.

A more typical implementation is to use an unordered_map instead of a map, since the hash table of unordered_map is faster to look up than a map when the table gets big.

On 10/11/2018 at 5:30 AM, frob said:

It looks fine with a once-over.

This is the type of code that every game builds, and it is simple enough that it is rarely reused. That is the only complaint about it.  It re-invents the wheel, and it is an easy wheel to re-create and customize when needed. 

A more typical implementation is to use an unordered_map instead of a map, since the hash table of unordered_map is faster to look up than a map when the table gets big.

On the start: Thanks!

What I can only not agree that: "it is simple enough that it is rarely reused". It took some time to catch all bugs like listen/unlisten during notification. So important thing is it well tested not mentioning performance measure.

What is different in this implementation that you don't have to inherit form common event or inherit to listen/unlisten. Specially not everyone is template ninja to write cool stuff (neither am I but I try to achieve something cool and easy to use :))

 

Thanks for tip with unordered_map but I think I tested in past (performance) and it gives worser results but I will double check and document that.

 

Also one of big features I want to add is printable graph of events (graphviz) so it would be more easy to track your events. No lib has such feature :)

 

As for unordered_map, check out https://github.com/greg7mdp/sparsepp - works as a drop-in replacement and is quite fast.


Another thing you should mention on the main page how this behaves with multiple threads and how it allocates its memory.
Is it ye 'ol queue from everywhere but process in one place? lockless/mutexes/blocking/whatever?
Can i give it custom allocators or make it use some kind of fancy pool/freelist/whatever allocation?


 

This topic is closed to new replies.

Advertisement