Comments (10)
@HavenDV what would you want this property to do? What's your workaround, with an example?
from reactiveui.uno.
Ok yeah, this will have to be fixed then.
I'll see if we can get a point release next release.
from reactiveui.uno.
At the moment, I am using the solution via DI:
_ = services
// WebAssembly does not support Threads for .Net5/.Net6 now.
.AddSingleton(static provider =>
{
return provider.GetRequiredService<Platform>() switch
{
Platform.WebAssembly => RxApp.MainThreadScheduler,
_ => RxApp.TaskpoolScheduler,
};
})
and explicitly get and pass taskPoolScheduler in code.
Platform
is explicitly specified in Shared code through #ifdef instructions.
I see the solution through detecting the WebAssembly platform at a platform agnostic level (Inside the main ReactiveUI package targeting .Net Standard 2.0) and returning the correct TaskPoolScheduler (RxApp.MainThreadScheduler) for the WebAssembly platform.
The main difficulty is in detecting WebAssembly.
from reactiveui.uno.
are you using ReactiveUI.Uno nuget package, It's meant to go the WasmScheduler if it's netstandard2.0
A Web Assembly versions of the System.Reactive classes. - Reactive.Wasm/WasmScheduler.cs at master ยท reactiveui/Reactive.Wasm
from reactiveui.uno.
If I understand everything correctly, should I use this package at the platform level? Which causes the same difficulties, because our Core package with all ViewModels (and the code that uses specific Scheduler) targets the same as the main ReactiveUI package
from reactiveui.uno.
Just your views project, based on having ReactiveUI.Uno it'll run the registration in that project and should set it to a WasmScheduler.
from reactiveui.uno.
From my point of view, the ReactiveUI.Uno package should do this on its own.
Or there must be some documentation about it because I didn't notice anything about it until I heard from you.
from reactiveui.uno.
Yeah that's what it should do, if it's not its a bug.
What is TaskPoolScheduler by default before you do your override?
from reactiveui.uno.
I'm trying to find out. I still haven't figured out how to use Debugger with a WASM project.
from reactiveui.uno.
I added this to the App constructor of the Uno application:
public App()
{
Console.WriteLine(RxApp.TaskpoolScheduler);
#if __WASM__
PlatformEnlightenmentProvider.Current.EnableWasm();
#endif
Console.WriteLine(RxApp.TaskpoolScheduler);
Console.WriteLine(System.Reactive.Concurrency.WasmScheduler.Default);
from reactiveui.uno.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactiveui.uno.