Click or drag to resize
AuthenticatedSessionExecuteAsync Method (IMetricsRequest)
Executes the IMetricsRequest asynchronously.

Namespace: KomfoSharp.Sessions.Authenticated
Assembly: KomfoSharp (in KomfoSharp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public Task<IMetricsResponse> ExecuteAsync(
	IMetricsRequest metricsRequest
)

Parameters

metricsRequest
Type: KomfoSharp.Sessions.Authenticated.Requests.Twitter.Followers.MetricsIMetricsRequest
The metrics request.

Return Value

Type: TaskIMetricsResponse
The IMetricsResponse.

Implements

IAuthenticatedSessionExecuteAsync(IMetricsRequest)
Examples
using (var komfoSession = komfoSessions
  .Authenticated
  .Token(token)
  .Create())
{
  var metricsRequest = komfoSession.Requests.Twitter.Followers.Metrics
    .TwitterHandles(new[] { "<twh1>", "<twh2>", "<twh3>" })
    .Create();

  var metricsResponse = await komfoSession.ExecuteAsync(metricsRequest);

  foreach (var metric in metricsResponse.Data)
  {
    this.ShowMetric(metric);
  }
}
using (var komfoSession = komfoSessions
  .Authenticated
  .Token(token)
  .Create())
{
  var metricsRequest = komfoSession.Requests.Twitter.Followers.Metrics
    .TwitterHandles(new[] { "<twh1>", "<twh2>", "<twh3>" })
    .Fields(MetricFields.Channel | MetricFields.RequestHandle | MetricFields.Engagement)
    .WithPolling(polling => polling.Interval(TimeSpan.FromSeconds(15)).Attempts(4))
    .Create();

  var metricsResponse = await komfoSession.ExecuteAsync(metricsRequest);

  foreach (var metric in metricsResponse.Data)
  {
    this.ShowMetric(metric);
  }
}
See Also