Skip to content
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

refactor: Move to new FFI combined interaction model #414

Merged
merged 1 commit into from
Aug 1, 2022

Conversation

adamrodger
Copy link
Contributor

The previous FFI separated sync and async interactions and so the API of PactNet reflected this. The new FFI, particularly in specification v4, brings these two back together as a single unified 'interaction' and so the API of PactNet can now reflect this also.

This means that MessagePactHandle and MessageHandle are removed in favour of the existing PactHandle and InteractionHandle types, which were previously only used for synchronous interactions but now support asynchronous message interactions also.

In turn, this allowed the MockServer and MessageMockServer classes to be combined, with an internal API refactor to extract the common methods whilst keeping the sync- and async-specific methods separate.

The next stage will be to wrap the unsafe interop calls entirely within the new sync and async drivers so that the remainder of the code doesn't need to deal with unsafe primitives like PactHandle and InteractionHandle.

There are no breaking public API changes as part of this refactor, although there are some backwards-compatible deprecations.

The previous FFI separated sync and async interactions and so the API of
PactNet reflected this. The new FFI, particularly in specification v4,
brings these two back together as a single unified 'interaction' and so
the API of PactNet can now reflect this also.

This means that MessagePactHandle and MessageHandle are removed in
favour of the existing PactHandle and InteractionHandle types, which
were previously only used for synchronous interactions but now support
asynchronous message interactions also.

In turn, this allowed the MockServer and MessageMockServer classes to be
combined, with an internal API refactor to extract the common methods
whilst keeping the sync- and async-specific methods separate.

The next stage will be to wrap the unsafe interop calls entirely within
the new sync and async drivers so that the remainder of the code doesn't
need to deal with unsafe primitives like PactHandle and InteractionHandle.
@adamrodger adamrodger merged commit 1a533c6 into master Aug 1, 2022
@adamrodger adamrodger deleted the refactor/new-ffi-method branch August 1, 2022 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant