Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

What Lifetime/Lifestyle should ETClient be? #94

Open
TraGicCode opened this issue Apr 28, 2021 · 2 comments
Open

What Lifetime/Lifestyle should ETClient be? #94

TraGicCode opened this issue Apr 28, 2021 · 2 comments

Comments

@TraGicCode
Copy link

TraGicCode commented Apr 28, 2021

The documentation is not clear as to what the lifetime/lifestyle should be configured for the ETClient. If i were to guess it's really trying to say singleton. Without singleton then caching and refreshing of tokens would be pretty useless feature. Can someone confirm this?

https://github.com/salesforce-marketingcloud/FuelSDK-CSharp/blob/aebf1e071723a6686ac567bc2c25bbdab14d54a0/README.md#example-request

The ETClient class takes care of many of the required steps when accessing Salesforce Marketing Cloud's API, including retrieving appropriate access tokens, handling token state for managing refresh, and determining the appropriate endpoints for API requests. In order to leverage the advantages this class provides, use a single instance of this class for an entire session. Do not instantiate a new ETClient object for each request made.

Thanks!

@TraGicCode
Copy link
Author

Also, if you have a single application that is responsible for sending emails for multiple business units will creating 2 singletons ETClient Singletons be problematic?

@TraGicCode
Copy link
Author

Cc @GDU-SF

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant