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

Make ITransport and SentryOptions.Transport public #1602

Merged
merged 4 commits into from
Apr 26, 2022

Conversation

mattjohnsonpint
Copy link
Contributor

@mattjohnsonpint mattjohnsonpint commented Apr 26, 2022

In #1560, we created the HttpTransportBase class, containing the "guts" of the HttpTransport assembled such that others could extend it to create their own transports without loss of features that are wired at the transport. However, we didn't create an easy way to actually attach a custom transport at that time, because we were primarily focused on getsentry/sentry-unity#657, which was already building it's own implementation of IBackgroundWorker where it could connect its own custom transport.

For others, the ideal place to attach a custom transport is on SentryOptions.Transport, as we do in unit tests. This PR makes that property, and the corresponding ITransport type public so that can happen. (It also removes IFlushableTransport just for cleanup. It wasn't adding anything.)

After this is released, the recommendation for custom transports is to implement similarly to the built-in HttpTransport.

public class SomeCustomTransport : HttpTransportBase, ITransport

One could also just implement ITransport without implementing HttpTransportBase, but then they would be missing out on any functionality wired up in the transport such as processing event handlers, client reports, etc.

Was unnecessary. Only the CachingTransport is ever flushed, right after it's created.
Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Matt

@mattjohnsonpint mattjohnsonpint merged commit 6a2f44c into main Apr 26, 2022
@mattjohnsonpint mattjohnsonpint deleted the make-transport-public branch April 26, 2022 23:47
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.

3 participants