kubos / kubos-old

An open source platform for satellites
http://kubos.com
Apache License 2.0
72 stars 23 forks source link

Event Driven Framework #169

Open plauche opened 7 years ago

plauche commented 7 years ago

We are considering building an event driven layer on top of the Kubos flight software framework. An initial prototype implementation was created as part of #168 and demonstrates what an event driven interface could look like in our context. However further discussion is needed to settle on some broader architecture directions and implementation details.

Items that still need discussions and/options weighed are:

plauche commented 7 years ago

Interesting article from ZeroMQ about different messaging architectures http://zeromq.org/whitepapers:brokerless.

plauche commented 7 years ago

Document Event Architecture Discussions

plauche commented 7 years ago

Here are a couple of interesting blog posts about testing message based systems

Designing with and around integration tests should be highly prioritized when building out this system.

plauche commented 7 years ago

Some of the differences between ZeroMQ and nanomsg - http://nanomsg.org/documentation-zeromq.html

OhMeadhbh commented 7 years ago

After review of issues above and additional internal discussions w/ Dave, we want to move forward w/ using 0MQ because:

Nanomsg is interesting, but 0MQ seems more mature with a larger community & better support. But who knows, this may change in the future.

Things we sort of wish it did out of the box include:

We thought about whether to use a broker or a non-brokered architecture: Arguments in favour of a non-brokered architecture:

Arguments in favour of a brokered architecture:

Additional Thoughts: While running through use cases on brokered vs. non-brokered messaging facilities, we realized there were two different types of messages: commands & events (that tell individual systems what to do (like "turn on radio" or "start taking pictures") ) and Jobs (which are much "higher level" like "take a picture over this WGS-82 location while pointed in a particular orientation") The two queues are distinct.

Also, if we're worried about single point of failure (and we are), then we should spend more time hardening the broker instead of debugging weird side-cases from the peer-to-peer / brokerless architecture.

There are probably several situations where we would need to provide responses to pub / sub messages. We think this can be done with unicast messaging.

Next Steps: Build a prototype "control plane" implemented as a message bus using 0MQ.