purgeQueue method

Future<Queue> purgeQueue(
  1. PurgeQueueRequest request
)

Purges a queue by deleting all of its tasks.

All tasks created before this method is called are permanently deleted.

Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.

Throws a http.ClientException if there were problems communicating with the API service. Throws a ServiceException if the API method failed for any reason.

Implementation

Future<Queue> purgeQueue(PurgeQueueRequest request) async {
  final url = _endPoint.replace(path: '/v2/${request.name}:purge');
  final response = await _client.post(url, body: request);
  return Queue.fromJson(response);
}