-
Notifications
You must be signed in to change notification settings - Fork 0
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
AM-75 Implement aquamarine as SOA software #101
Conversation
MaksymT17
commented
Aug 11, 2024
•
edited
Loading
edited
- Implement aquamarine as SOA software.
- Use shared memory for messaging.
- Add the possibility to run multiple client(master) applications. Each client may have its configuration.
- Define interface with Message types.
- Verify cross-platform build.
Applied SOA principle in aquamarine design. AM starts as a service wich will receive and respond to requestor of comparison. Am will be running untill DISCONNECT message would be received. Message flow: HANDSHAKE -> SET_CONFIG -> COMPARE -> .. -> DISCONNECT. Remove shared_ptr for configuration.
f48bf67
to
b2745e7
Compare
b2745e7
to
31cfdbf
Compare
161b5b9
to
a402e7d
Compare
Windows build artifacts have not been tested |
a402e7d
to
d99a65c
Compare
3a29d99
to
a7656be
Compare
ca2cd2a
to
47ca165
Compare
47ca165
to
9402fd5
Compare
056795e
to
84ebf49
Compare
4427943
to
42d6416
Compare
42d6416
to
7cfff36
Compare
0697d1f
to
7e28c17
Compare
b2a2675
to
927877e
Compare
d7acdc1
to
8a9f89d
Compare
{ | ||
printf("compare_ %s %s _\n", messageCompare->base, messageCompare->to_compare); | ||
auto iter = m_connections.processActionUpdate(message); | ||
m_amApi->setConfiguration(iter->configuration); // set configuration for this client | ||
printf("conf pixs %zu\n", iter->configuration.MinPixelsForObject); | ||
am::analyze::algorithm::DescObjects result; | ||
try | ||
{ | ||
result = m_amApi->compare(messageCompare->base, messageCompare->to_compare); | ||
} | ||
catch (const am::common::exceptions::AmException exc) | ||
{ | ||
std::cout << "Exception has been caught: " << exc.what() << ::std::endl; | ||
Message failed{messageCompare->id, MessageType::COMPARE_FAIL}; | ||
m_server->send(&failed); | ||
continue; | ||
} | ||
std::cout << "received after compare\n"; | ||
MessageCompareResult compare_result; | ||
compare_result.id = messageCompare->id; | ||
|
||
compare_result.payload_bytes = result.size() * sizeof(Rect); | ||
Rect *rects = static_cast<Rect *>(compare_result.payload); | ||
size_t id = 0; | ||
for (auto &rectangle : result) | ||
{ | ||
if (id == 100) // limit by 100 objects | ||
{ | ||
compare_result.payload_bytes = 100 * sizeof(Rect); | ||
break; | ||
} |
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.
All possible exceptions have to be handled.
An instance of a shared memory сщььгтшсфещк object has to be destroyed to be able to reuse synchronization primitives.
In case of forced termination of aquamarine process such sync primitives could be left in an unknown state and work with mapped memory have to be finalized correctly.