Skip to content

Commit

Permalink
Simplify session participants observer
Browse files Browse the repository at this point in the history
  • Loading branch information
sescalada committed Sep 25, 2023
1 parent b0626c4 commit bb021e3
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected override void Update(TimeSpan gameTime)
{
this.queueProcessingTcs?.Cancel();
this.queueProcessingTcs = new CancellationTokenSource();
this.queueProcessingTask = Task.Run(async () => await this.ProcessQueueAsync(this.queueProcessingTcs.Token)
this.queueProcessingTask = EvergineBackgroundTask.Run(async () => await this.ProcessQueueAsync(this.queueProcessingTcs.Token))
.ContinueWith(t =>
{
this.queueProcessingTask = null;
Expand All @@ -82,7 +82,7 @@ protected override void Update(TimeSpan gameTime)
{
this.logger?.LogError(t.Exception, "Error processing participants queue");
}
}));
});
}
}

Expand Down Expand Up @@ -112,15 +112,6 @@ await this.AddParticipantHierarchyAsync(action.ParticipantInfo, cancellation)
await EvergineForegroundTask.Run(() => this.RemoveParticipantHierarchy(action.ParticipantInfo.ClientId))
.ConfigureAwait(false);
}

// It looks like Android-based devices are under "pressure" when processing
// avatar parts load in different threads (maybe related with AssetsService not
// being thread-safe?). We give it some extra time, that seems to reduce the number
// of crashes in Quest 2 devices.
if (Platform.DeviceInfo.PlatformType == Common.PlatformType.Android)
{
await Task.Delay(100).ConfigureAwait(false);
}
}
}

Expand Down

0 comments on commit bb021e3

Please sign in to comment.