CrosRoad95
Looking for c# library to create graph, blueprint like functionality in unreal engine
i want to create unreal engine blueprint like functionality so i'm looking for library where i can create such graphs. I don't need visual part, i will code visual part
Something like https://github.com/RobinKa/netprints but i want to program those graphs/nodes
6 replies
Blazor, auto unsubscribe pattern
I have created website using blazor, and if some component subscribe to something then it implement IDisposable interface to cleanup subscriptions. Because i have also a little experience with angular, rx.js and simillar, i wonder if it is good idea to introduce simillar pattern to backend:
and base class will automatically cleanup all subscrptions, what do you think? do you have any other examples like this?
I ask because i'm warry that in more complex scenario where for example events are subscribed conditionally i may leave some not cleanuped event handlers
1 replies
Thread safe moving value between two objects
I have problem. Consider following class:
what i want to do is to thread safe move amount from one "Foo" object, to another that it won't overflow above "MaxAmount".
A bif more context: It is for game for items stacking purpose, it is used server side so two clients at once may attempt to move items.
Please focus on thread safety aspect
23 replies
Blazor rerender
Can i somehow make blazor rerender when property change automatically whereever property change? I don't want to add manually "StateHasChanged"
then i want to render it:
and make it automatically rerender when property "A" changed
Or maybe i need to wrap it somehow into a component? but i'm not sure if it's good idea?
Foo = <Property>@foo.A</Property>
2 replies
MudBlazor on net8, MudSelect not working
first of all: i googled this issue 9999 times and couldn't find solution.
https://github.com/MudBlazor/MudBlazor/issues/7510 - tried to set interactiveServer for one component, for entire application, nothing worked, when i click select button it doesn't show me options. When i set ref to select and attempt to use method "OpenMenu", it hang itd what i'm doing wrong.
Using .net8 and newest mudblazor lib
7 replies
❔ Question about getter property of list
so, i have some class containg property of type:
List<string>
, how can i thread-safe return this list as some kind of snapshot of current state of list?
right now i'm doing it in followoing way but i'm not sure if it okey
9 replies
❔ Garbage collection question
I see in many libraries examples where in DI ".AddScoped<>", ".AddTransient<>" is used instead of ".AddSingleton<>", example in fluent assertions example says:
services.AddScoped<IValidator<User>, UserValidator>();
and i wonder why? this class instance is sorto "read only" so it could be singleton? And here's my question regarding that, because singleton will create long lived instanced meanwhile the other two will live for let's say 100ms, they will be regularly cleared, less often reach further generation. I know that not all singletons are used at all time, they will live in memory for long time and cause extra pressure on garbage colletor.
What do you think? is it better to use Transient/Scoped even when singleton make sense from memory point of view?7 replies
❔ Polly - question
I have some method, but it can be quickly called multiple times and what i'm trying to do is that after certain amount of time it get called,
for example
Foo(); Foo(); Foo();
- called three times, but first two calls will be ignored because they happened too quickly and after let's say 200ms last foo get executed
can i achieve something like this using polly? https://github.com/App-vNext/Polly
it's probably called debouce, can polly do this?5 replies