Debugging log for Daemon
s and Handler
s.
#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
-
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
Message
constructor with the daemon or handler that produces it.For example,
beamlime.applications.daemons.DataStreamSimulator
generatesRawMessageSent
,and
beamlime.applications.handlers.DataReductionHandler
receives it.So
RawMessageSend
should rather be inbeamlime.applications.daemons
, not inbeamlime.applications.handlers
if not somewhere else.try
-except
instead ofhasattr
.Some
Handler
s 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.asend
didn't make first-message processing easier.It was very messy after-all since the first
asend
call should be called withNone
.Then it needs try-exception anyways and it made
type-hint
very messy.It was better to stick to the
try
-except
...Beta Was this translation helpful? Give feedback.
All reactions