Exemplo n.º 1
0
        public async Task <WurmDateTime?> TryGetCurrentTimeAsync(CancellationToken cancellationToken)
        {
            var result =
                await
                jobRunner.Run(new CurrentWurmDateTimeJob(ServerName), cancellationToken).ConfigureAwait(false);

            return(result.WurmDateTime);
        }
Exemplo n.º 2
0
        public async Task <ServerName> TryGetServerAsync(CharacterName character, DateTime exactDate, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            // attempt to check cache directly, result might have been already found by another query.
            var fastResult = jobExecutor.CheckCacheForServerInfo(character, exactDate);

            if (fastResult != null)
            {
                return(fastResult);
            }
            return(await runner.Run(new GetServerAtDateJob(character, exactDate), cancellationToken).ConfigureAwait(false));
        }
Exemplo n.º 3
0
        public async Task <IList <LogEntry> > ScanAsync(LogSearchParameters logSearchParameters)
        {
            var result = await runner.Run(logSearchParameters, CancellationToken.None).ConfigureAwait(false);

            return(result.LogEntries);
        }