-
Notifications
You must be signed in to change notification settings - Fork 242
Pinning Agent refactor to new_epoch
event
#4499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
new_epoch
eventnew_epoch
event
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gen-server process should be enough to run this, it is even aptly named something_worker. Spawning yet another process is overkill.
4cea060
to
853f616
Compare
The |
Yes, naming looks updated and correct, the drawback of spawning yet another process is that you need to register for events every time, etc. It is much cleaner and not a lot of work to just put that logic directly in the gen_server. |
As per "advice" from @richcarl and @happi and others I put it in a separate worker process and I like the look of it (and I really don't like the look of If it's very very important to you @hanssv, I will refac again, but I really do like the current impl and it's not particularly non-standard. |
If Richard and Happi with a straight face will claim that this implementation is superior I will consider to change my mind. |
Not superior perhaps, but valid 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, this one is much nicer!
#{caller_id => aeser_id:create(account, Who) | ||
, nonce => Nonce |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix: Space after the curly, and comma aligns with curly...
Move pinning agent invocation code from inner consensus callbacks to separate gen_server+worker process.
This PR is supported by Æternity Foundation