-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Refactor AT services #461
Refactor AT services #461
Conversation
share all data using only AcraTranslatorData struct * pass build flags in integrations tests * fix overriding test in integrations tests * make getClientID as separate function instead of method of TLSServiceWrapper
// OngRPCServerInit call all registered callbacks on gRPC server initialization | ||
func OngRPCServerInit(server *grpc.Server, data *common.TranslatorData, service DecryptService) { | ||
lock.Lock() | ||
defer lock.Unlock() |
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.
Do we really need to use defer
here? If I am not mistaken the OnServerInit
function does not return any error so here no possible early-exit
scenarios, right? Could we place it after the loop statement?
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.
Defer has used because of subscribers may panic. Yes, the program will interrupt and exit if nothing catches this panic. But for a future better to handle it from the start correctly.
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 to me
…ide of newServer function
update golang services according to updates grpc/grpc-go#3669 update Makefile with up-to-date building commands
There are nothing changed in features or public API. Only internal structures and implementations.
All shared components have moved to
AcraTranslatorData
structure that used to initialize services (HTTP, gRPC) and passed to callbacks that called on server initialization.Refactored initialization dependencies like poison record callbacks, tokenizer and moved them from redundant factories to program startup to initialize them at start and share.
Added registries that store callbacks for events from gRPC/HTTP servers. It helps extend implementation with build flags. Also, updates integration tests with new env variable that accept and pass build flags for compilation commands.
Updated
go_package
option in .proto file to full path to fix import in other .proto filesAnd renamed
TestPoisonRecordWholeCellStatusOff
(that exists in 2 examples) with proper suffix.Checklist
with new changes