Last active
January 16, 2020 08:42
-
-
Save ItayPodhajcer/73647dc590ff7d31ac244a3c0ac724c5 to your computer and use it in GitHub Desktop.
ethereum-event-azure-function-trigger/EthereumEventListener.ListenAsync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async void ListenAsync(CancellationToken cancellationToken) | |
{ | |
await Task.Run(async () => | |
{ | |
while (!cancellationToken.IsCancellationRequested) | |
{ | |
var eventsData = await _event.GetFilterChangeDefault(_filter); | |
ProcessEvents(eventsData, cancellationToken); | |
await Task.Delay(EventPollingDelay); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment