Arlodotexe / strix-music

Combine any music sources into a single library. It's your music. Play it your way.

Home Page:http://www.strixmusic.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: New core powered by OwlCore.Remoting

Arlodotexe opened this issue · comments

commented

Background

OwlCore.Remoting is a lightweight RPC framework that works anywhere .NET Standard 2.0 is supported.

The framework was originally created for 2 purposes: Synchronizing UI between devices and enabling remote execution of code that is sideloaded in another application, in another process or running on another machine.

Work on this was started here, but had to be paused to focus on other parts of the SDK so we could open source on time. This includes both implementation and unit tests.

The plan

Since cores have all the members needed to know when data is changed, we can create a super clean API surface that looks roughly like this:

// Machine/Process 1- "Host" who has the running code
var core = new LocalFilesCore(folderData, config);
var host = new RemoteCore("myUniqueId", core, messageHandler);

// Machine/Process 2 - "Client" who doesn't have the running code
var client = new RemoteCore("myUniqueId", messageHandler);

// When calling a method on the client, it uses RPC calls to get the data from the host core.
var items = await client.Library.GetTracksAsync(5, 5).ToListAsync();

// The host uses RPC calls to notify the client about events and property changes.
client.Library.TotalTrackCountChanged += (s, e) => { ... };

Todo list

  • Create and write tests for all required models
  • Identify and evaluate extra services that may be needed (i.e. RemoteNotificationsService)
  • Test with a real core running out of process
commented

This could end up delayed until after the vNext of OwlCore.Remoting (AceRpc) is finished, which will use source generators instead of IL weavers.

commented

This idea may end up scrapped entirely, allowing us to jump directly to cross-language cores based on WebAssembly.

See here: #229