Closed a4tarasiuk closed 1 year ago
Hello! It is definitely possible to implement. Will try to add to the upcoming release.
Hello! It is definitely possible to implement. Will try to add to the upcoming release.
Thanks! Great!
Also, have a question: Is diator is async only because of di package? I do not see any async operations except of resolving dependencies via async executor in di package. Is it possible to port diator to sync mode?
If there is something I can do, please, just tell me.
Also, have a few more questions not related to this topic, just do not wanna create many issues. Is there any road map for development? Very interesting the content of the next releases. There are interesting components (like NotificationEvent
) which are cannot be used now (if I clearly understood everything from docs and code), and it would be nice to know when they are planned to be supported etc.
Yeah, got typing issue during creating handler for NotificationEvent
. Mypy throws an error, because of generic of EventHandler
event type (TypeVar("E", bound=DomainEvent, contravariant=True)
) is bound to DomainEvent
, while NotificationEvent
is just Event
. The same for ECSTEvent
.
EventHandler
requires only DomaintEvent
based events.
Unfortunately, there are several places where mypy throws this kind of error. Thanks for sharing, I will include it to the next release. Planning to start work on it on the weekends!
Sorry, I read your comment second time. EventHandler accepts only DomainEvent because it is designed in order to handle only business logic. Whereas, notification and ECST events are sent asynchronously to the message broker. Afterwards, it could be handled by other services (consumers). Hope I described clearly :)
Oh, yeah, got it! Thanks for the explanation.
Also, could you please answer this one - https://github.com/akhundMurad/diator/issues/26#issuecomment-1708943177
Diator is async only. Probably, in the far future it will have support of the sync mode
Is it possible to add support for https://python-dependency-injector.ets-labs.org/ ? Or maybe there are some concerns about why it is not used?