Calling SubscriberClient.Create(...)
instead of .CreateAsync(...)
allows you to pass in the underlying SubscriberServiceApiClient
instance(s).
Edit: Apologies, the above is incorrect, it should be:
Instantiate a SubscriberClientImpl
directly instead of calling SubscriberClient.CreateAsync(...)
. This allows you to pass in the underlying SubscriberServiceApiClient
instance(s).
Note that you can pass new SubscriberClient.Settings()
for the settings
argument, and null
for the shutdown
argument as defaults.
SubscriberServiceApiClient
can be mocked - either directly, or by instantiated a SubscriberServiceApiClientImpl
instance and passing in a mocked Subscriber.SubscriberClient
.
When testing, note that SubscriberClient
is multi-threaded and with default settings will call the callback passed to StartAsync
concurrently from multiple threads.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…