{"action":"created","issue":{"url":"https://api.github.com/repos/sendgrid/sendgrid-csharp/issues/142","labels_url":"https://api.github.com/repos/sendgrid/sendgrid-csharp/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/sendgrid/sendgrid-csharp/issues/142/comments","events_url":"https://api.github.com/repos/sendgrid/sendgrid-csharp/issues/142/events","html_url":"https://github.com/sendgrid/sendgrid-csharp/issues/142","id":82344858,"number":142,"title":"Possible to re-introduce a proper synchronous API?","user":{"login":"DavidR91","id":282737,"avatar_url":"https://avatars.githubusercontent.com/u/282737?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidR91","html_url":"https://github.com/DavidR91","followers_url":"https://api.github.com/users/DavidR91/followers","following_url":"https://api.github.com/users/DavidR91/following{/other_user}","gists_url":"https://api.github.com/users/DavidR91/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidR91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidR91/subscriptions","organizations_url":"https://api.github.com/users/DavidR91/orgs","repos_url":"https://api.github.com/users/DavidR91/repos","events_url":"https://api.github.com/users/DavidR91/events{/privacy}","received_events_url":"https://api.github.com/users/DavidR91/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-29T09:13:30Z","updated_at":"2015-05-29T17:49:40Z","closed_at":"2015-05-29T17:49:40Z","body":"Perhaps I'm in the minority, but asynchrony is actually really *un*helpful for my particular use of Sendgrid.\r\n\r\nI specifically **want** to wait for the POST to finish so that I can mark the work as successful/unsuccessful at the point when it is processed. Deferring results until an unknown point in the future makes determining success/failure significantly harder \r\n\r\nIs there any chance of introducing a better synchronous API? Or perhaps splitting the library in two for focusing on synchrony vs. asynchrony?\r\n\r\nFailing these, is there some way we can at least have better result tracking of asynchronously sent messages? (e.g. a token for tracking their state rather than just receiving errors at unknown points in the future)"},"comment":{"url":"https://api.github.com/repos/sendgrid/sendgrid-csharp/issues/comments/106885613","html_url":"https://github.com/sendgrid/sendgrid-csharp/issues/142#issuecomment-106885613","issue_url":"https://api.github.com/repos/sendgrid/sendgrid-csharp/issues/142","id":106885613,"user":{"login":"brandonmwest","id":433682,"avatar_url":"https://avatars.githubusercontent.com/u/433682?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonmwest","html_url":"https://github.com/brandonmwest","followers_url":"https://api.github.com/users/brandonmwest/followers","following_url":"https://api.github.com/users/brandonmwest/following{/other_user}","gists_url":"https://api.github.com/users/brandonmwest/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonmwest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonmwest/subscriptions","organizations_url":"https://api.github.com/users/brandonmwest/orgs","repos_url":"https://api.github.com/users/brandonmwest/repos","events_url":"https://api.github.com/users/brandonmwest/events{/privacy}","received_events_url":"https://api.github.com/users/brandonmwest/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T17:49:40Z","updated_at":"2015-05-29T17:49:40Z","body":"The thing is that HttpClient is all async, so if you make a \"synchronous\" method you're just mixing sync and async code. You're welcome to wrap the method in something that awaits it to simulate the async method yourself (which is what this library used to do, so looking at the code history will show how), but mixing sync and async is generally not advisable. For tracking async messages and error states, that's really dependent on the code you write to handle the async tasks and not a concern of the async call itself.\r\n\r\nAlso keep in mind that theSendGrid API calls themselves are async, because we accept the message before verifying that it can be successfully processed and sent."}}