dashbitco / broadway_cloud_pub_sub

A Broadway producer for Google Cloud Pub/Sub
Apache License 2.0
70 stars 24 forks source link

Use hackney as the default adapter for GoogleApiClient #20

Closed mcrumm closed 5 years ago

mcrumm commented 5 years ago

This PR handles the adapter overrides for the Tesla.Client structs built by the :google_api_pub_sub library. This change makes hackney the HTTP adapter for BroadwayCloudPubSub connections. To accommodate this, hackney is now a required dependency for :broadway_cloud_pub_sub, along with Tesla 1.2.

To ensure we could still replace the Tesla adapter with the mock adapter in our tests, I exposed a :connection option for GoogleApiClient, but I purposefully did not document it, as it's really not intended to be overridden by a user-level implementation. Better to document it as an internal option, or leave it as-is?

Closes #18

mcrumm commented 5 years ago

I created a separate issue to discuss the connection pool (#19) because I don't think the producer currently has enough information to make any determination as to the proper pool size.

mcrumm commented 5 years ago

@josevalim Thank you for the suggestions -- reduced complexity FTW!