News for hackers. Stuff that matters.
Re:Logging as a code smell by SV_BubbleTime on Sunday January 09, 2022 @09:00PM (#29869686)
I love the idea of an event bus, but all I use is C and embedded. The last time I considered it I backed away from it.

Wish there was effort to establish a pattern for this in C.

Re:Logging as a code smell by kevin_thibedeau on Tuesday January 11, 2022 @02:18AM (#29888553)
You can do this in C without all the enterprisey ceremony. All you need is a way to send messages to a queue and have them dispatched to registered listeners. The "message" can be nothing more than an encoded integer or something more complex. This lets you have a decoupled interface between interacting subsystems.
Re:Logging as a code smell by gurjeet on Sunday January 09, 2022 @09:35PM (#29869929)
I believe ZeroMQ has libraries/implementation suitable for embedded systems.
Re:Logging as a code smell by SV_BubbleTime on Monday January 10, 2022 @09:17PM (#29886422)
Checked it out, no go.

Replies extremely heavy on POSIX api and threads. All the cool functionality is with sockets. There is an inproc:// but it doesn’t do much.

Lighter to just work it out using RTOS objects like queues and streams.