Hello PlayFab Community,
I'm currently working on a feature where I need to fetch PlayFab profiles for multiple users. My current implementation involves making asynchronous calls to GetPlayerProfileAsync for each user, utilizing Task.WhenAll for parallel processing. Here's a snippet of my implementation:
var tasks = playersStatisticsData.Select(async entry =>
{
var profile = await PlayFabServerAPI.GetPlayerProfileAsync(new GetPlayerProfileRequest()
{
PlayFabId = entry.PlayFabId,
ProfileConstraints = new PlayerProfileViewConstraints()
{
ShowAvatarUrl = true,
ShowDisplayName = true
}
});
entry.Profile = profile.Result?.PlayerProfile;
entry.DisplayName = profile.Result?.PlayerProfile.DisplayName ?? entry.PlayFabId;
return entry;
}).ToList();
await Task.WhenAll(tasks);
Does PlayFab support batch processing for profile retrieval, and if so, what is the recommended approach?
If batch processing isn't supported, what are the suggested strategies to optimize and manage multiple GetPlayerProfileAsync calls to ensure performance and avoid potential rate-limiting issues?