Repository navigation
Debugging log for Daemons and Handlers.
#148
YooSunYoung
started this conversation in
Design Choices
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Message constructor should be with the generator(daemon or handler) rather than the receiver(only handler).
Since we are using
Protocol, handlers and daemons don't have to know about each other.So it only makes sense to keep the
Messageconstructor with the daemon or handler that produces it.For example,
beamlime.applications.daemons.DataStreamSimulatorgeneratesRawMessageSent,and
beamlime.applications.handlers.DataReductionHandlerreceives it.So
RawMessageSendshould rather be inbeamlime.applications.daemons, not inbeamlime.applications.handlersif not somewhere else.try-exceptinstead ofhasattr.Some
Handlers had to initialize its status according to the first message it processes.In that case, it is better to use
try-except, i.e. withAttributeError,so that the first-message check doesn't cost anything.
AsyncGenerator.asenddidn't make first-message processing easier.It was very messy after-all since the first
asendcall should be called withNone.Then it needs try-exception anyways and it made
type-hintvery messy.It was better to stick to the
try-except...All reactions