Design problem:
Using a non-streaming component (Collection, API, ...) in / with a multi-threaded component ...
Example:
component1 : multithreaded socket serverthat sends messages ... to a message handler
component2 . A non-flowing message handler that processes messages ... from the server
My decision:
By adding a thread-safe component ( buffer ) between the server and the message handler, the buffer will receive messages with a multi-threaded image from the server and send them in the same order for the message handler in one thread .
My question is:
Is there a better solution? Can the appropriate design pattern be a proxy or a pipeline ?
source
share