Integration with Arcor2.ClientSdk.Communication library #258
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduction
The library mostly replaces the
WebSocketManager
class, which has been renamed toCommunicationManager
and now holds the library client. I decided to retain its responsibility of invoking other Manager's methods on events, similarly to the previous architecture.The library also eliminates the need for the
NativeWebSockets
package, which has as such been removed from the git submodules.Inclusion of the Library
The library is included by referencing an assembly file (similar to the now-removed OpenApi model assembly). I chose this approach to avoid adding an extra third-party dependency for some implementation of NuGet package manager for Unity. Newer versions of the assembly file will later be automatically generated through the CD/CI pipeline on the library repository, making updates as simple as replacing the assembly file.
Conversion of Existing Code
Most changes listed in the diff are mainly renames. Code that previously expected methods with a callback parameter has been updated to use asynchronous methods or Task continuations. A dispatcher object was added, as all events from the library are generated on a non-main thread.
Testing
Each action that involves communication with the ARCOR2 server has been manually tested, and everything seems to behave as expected.
Let me know if I should change or further update anything!