Review feedback

This commit is contained in:
Eric Harding committed 2019-02-06 14:48:18 -05:00
1 parent a7d71fe170
commit 99f1d1fa01
1 file changed
+2 -2
+2 -2
View File
@@ -1,5 +1,5 @@
# API Threading
# API Client Threading
BTS API provides two types of calls. There are RPC (remote procedure calls) which accept an argument and return a value and there are streams of tabular data which we call subscriptions. All communication to and from the server happens on a connection thread owned by the ServiceContext object and data must be marshaled back to the right context when the call is complete.
@@ -7,7 +7,7 @@ BTS API provides two types of calls. There are RPC (remote procedure calls) whi
### C#
All API calls provide both a synchronous and [asynconous](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/async) version. If you are calling the API from a WPF or Windows Forms application you should always prefer the async version of the method because it will efficiently make the call and resume execution on the correct thread without blocking or lagging user interactions. The syncronous calls are intended for use in console applications where nothing else needs use of the thread until the data is available.
All API calls provide both a synchronous and [asynchronous](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/async) version. If you are calling the API from a WPF or Windows Forms application you should always prefer the async version of the method because it will efficiently make the call and resume execution on the correct thread without blocking or lagging user interactions. The synchronous calls are intended for use in console applications where nothing else needs use of the thread until the data is available.
The async version of the method will return a `Result<T>` type which is used to signal if an error occurred during the call. You should test the Result.success to see if the call succeeded before using Result.value.