-
-
Notifications
You must be signed in to change notification settings - Fork 29
Request Caching
MrCakeSlayer edited this page Sep 24, 2022
·
1 revision
Lavalink4NET supports request caching of tracks to the Lavalink node.
To use this feature an implementation of ILavalinkCache is required. You can use the Lavalink4NET.MemoryCache NuGet-Package for an example implementation.
using Lavalink4NET;
using Lavalink4NET.MemoryCache;
var cache = new LavalinkCache(); // <--
var myNode = new LavalinkNode([...], cache);
using Lavalink4NET;
using Lavalink4NET.MemoryCache;
using Microsoft.Extensions.DependencyInjection;
var collection = new ServiceCollection()
.AddSingleton<ILavalinkCache, LavalinkCache>() // <--
.AddSingleton<IAudioService, LavalinkNode>()
.AddSingleton<IDiscordClientWrapper, ...>()
.BuildServiceProvider();
Lavalink4NET Wiki - Licensed under MIT