Coder Social home page Coder Social logo

analogrelay's Introduction

Ashley Stanton-Nurse (she/her)

Mario waves hello

๐Ÿ‘‹ I'm an engineer at Regression Games building cool stuff.

๐Ÿ  I live in Seattle ๐Ÿ‡บ๐Ÿ‡ธ, grew up in Vancouver ๐Ÿ‡จ๐Ÿ‡ฆ, and have lots of family in ๐Ÿ‡ฌ๐Ÿ‡ง.

โ“ Got a question for me? Just file an issue in my personal repo.

๐Ÿ”ญ Working on Regression Games, ๐Ÿ‘ถ parenting.

๐Ÿ• Previously: ASP.NET Core, SignalR, NuGet, Razor, :octocat: GitHub

๐ŸŒฑ Learning Go, re-learning Ruby.

๐Ÿ•น๏ธ Play Nintendo, PS5, Board Games, D&D.

๐Ÿ‘ทโ€โ™€๏ธ Building a ๐ŸŽฎ NES emulator, an operating system, and other fun stuff.

๐Ÿ’ฌ Ask me about .NET, ASP.NET, Rust

Contact Me

Cryptographic Identities

The following Cryptographic Identities are associated with me:

  • SSH Git Signing Key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEjRwisd5P4UEZtXMO19uk+ly2Jbu9LgLmGmlmWz7Mbh
  • PGP Git Signing Key: 42ECAC889F98413E5C23970604277A6059CB213C (on keyserver.ubuntu.com)
  • PGP Email Key: 8C18BFDC0BD12A86615893D51408A22DB14E40D8 (on keyserver.ubuntu.com)

analogrelay's People

Contributors

analogrelay avatar

Watchers

 avatar  avatar  avatar

Forkers

mytahir dgoemans

analogrelay's Issues

SignalR & Azure App Service Memory Usage

Hi Andrew,

Hope you are doing well. I wanted to seek your help to resolve one of issue we are facing. We use SignalR in one of our enterprise grade applications. We are facing few challenges in Memory consumption. We have hosted signalr on Azure App service which is configured to scale based on memory. Currently the app service is scaling to 7 instances. Upon taking a memory dump there are two set of snapshots

Snapshot 1: Shows LocalKeyEventInfo and ScaleoutMapping remain in memory
image
Snapshot 2: Refered from
image

Snapshot 3:
image
image

If you can share some guidance on how we could resolve this it would really help us.

SignalR Libraries File version
image
Microsoft.AspNet.SignalR.Core.dll - File version 2.2.50714.868

Thanks
Sam

ASP.NET Integration Testing with XUnit

Hey Ashley! I see you are an engineer on ASP.NET. I've been working on some integration testing and would love some feedback/advice about how to approach it better and to see if I'm understanding how ASP.NET servers work well enough. I've been considering writing a blog post to help future me and others learn how to approach asp.net integration tests.

For some context--I started digging deep into the ASP.NET code-base when I was trying to set a body size limit on a particular Controller endpoint. I was doing TDD with XUnit and Mvc.Testing.WebApplicationFactory<TEntryPoint> for integration tests. The RequestBodySizeLimit attribute I added to an action didn't seem to have any effect and I wanted to know why. I finally figured out in a closed issue from a few years ago (This is where I saw your profile in a reply) that the Features of the test server created by Testing.WebApplicationFactory does not have all the Features that the standard one does.

This gets to my first question: I see you can add middleware to add features via a Features.Set<IMyFeature>(instance) call, but where are the initial features of the test server defined? I only found RequestContext's initialization of features which creates a new instance of
StandardFeatureCollection. I was curious if there is a earlier or more appropriate point to add features.

Another question is am I approaching the reintroduction of the IHttpMaxRequestBodySizeFeature correctly?
To add it back, I created a live Startup class with a virtual noop function at the beginning of the Configure function. Now my TestStartup class can override that and add some app.Use() calls to add some features to the context. It doesn't seem like I can bring back the exact IHttpMaxRequestBodySizeFeature implementation of the standard ASP.NET server because that is actually implemented by RequestContext and I guess that's not used in the test server case? Something lighter is? Where do I find that test server/feature code? With this approach it seemed I also needed to reimplement the Body Stream wrapper class that can make use of the feature. I guess the Feature is really just a setting and the body stream reader must read the setting and decide when to error out. I found a similar class in tests of the aspnetcore repo and my middleware looks like:

        app.Use((httpContext, next) =>
        {
            var testHttpMaxRequestBodySizeFeature = new TestHttpMaxRequestBodySizeFeature();
            httpContext.Features.Set<IHttpMaxRequestBodySizeFeature>(
                testHttpMaxRequestBodySizeFeature);

            httpContext.Request.Body = new RequestBodySizeCheckingStream(
                httpContext.Request.Body,
                testHttpMaxRequestBodySizeFeature);

            return next(httpContext);
        });

An additional complexity is that if I want my TestStartup to be in a test assembly, I now have to do a lot of extra configuring to add controllers from my implementation assembly, and likely need to set some other paths because the test factory looks to the assembly of TestStartup rather than Startup. Are you aware of a sample somewhere that shows how to do this?

Just seems like a lot of code to be able to test this one thing and I'm not sure it's worth it since it's not the true implementation anyway. I am debating just writing a test that checks that the attribute exists on the action instead. Any advice you have for me here?

I guess I just need someone to tell me if I'm doing it right or making it too complicated. It was all going pretty smooth until I hit this missing feature and then getting it to work turned into quite the mess of extra code.

Blazor server app on PCF with websocket connection issues

Hello, I am trying to deploy a Blazor server application on Pivotal cloud foundry - with Nginx reverse proxy and Kestrel web server. When I try to run on more than 1 instance, the websocket connection intermittently fails (works fine with 1 instance). I did read about the Azure SingalR service, but is not an option since we are not deploying the app to Azure. I tried out the Redis backplane, but we could not get to set the nginx with sticky session as our org does not permit that.
I tried playing around with the HubConnection settings, specifically using websocket transport and Kestrel settings but that did not help much.
What are the other options I could try. Please help me with getting this to work.

Here is the error message I got from the Developer tools -
Websocket connection to failed: Error during webSocket handshake: unexpected response code: 404

WebSocketsErrorHRM.txt

SignalR, How to define methods in the Hub class that clients can call

Hi anurse,
reading through
https://docs.microsoft.com/en-us/aspnet/signalr/overview/guide-to-the-api/hubs-api-guide-server#how-to-define-methods-in-the-hub-class-that-clients-can-call
I came along
https://github.com/dotnet/AspNetDocs/blob/main/aspnet/signalr/overview/guide-to-the-api/hubs-api-guide-server/samples/sample23.cs?highlight=5

In order for this to work mustnโ€™t Hub be extended with a Generic type/interface that declares โ€œaddNewMessageToPage(name, message)โ€? I.e.

public interface IMyClient
    {
        Task addNewMessageToPage(string name, string message);
    }
    public class ContosoChatHub : Hub<IMyClient>
    {
        public async Task NewContosoChatMessage(string name, string message)
        {
            await Clients.All.addNewMessageToPage(name, message);
        }
}

Regards
Clemens
PS: sorry for bugging you with the same issue by email ;-)

CREATE A BACKGROUND SERVICE IN ASP.NETCORE

Hello ,

I have a web api created in asp.net core 3.1 , i want to be able to process some long running task in a "job like" however without creating a console application or without using a queuing (pub/sub).

How do i achieve this in asp.netcore.

Example
request -> example.com/api/submit_application -> response --> {"message":"thanks you we have recieved your application"}

Function longruningtask submit_application{

  • check if applicant is valid
  • check claimtype
  • check if qualifies
  • check contact exits
  • check claim
  • send email
  • notify representative
  • validate claim
  • log claim in database
  • ............
    }

One page Razor/Blazor file

Hi... I've just known you via MS Dev posts... May I have a question about Razor/Blazor...?

Can I create a razor file with Razor tags and C# code and then to be transpiled into HTML and JavaScript without MVC or any other architecture?

Normally, the Blazor code flow is :
Program.cs -> Startup.cs -> _Host.cshtml -> App.razor -> MainLayout.razor -> NavMenu <-> @page <-> @Body
This would be the whole nine yards...

I just simply want a Something.razor file to be generated to Something.html with Something.js for a browser.
If I want it as desktop app, maybe it could be compiled into .exe file or .app on macOS... via WebWindow or WKWebView... ๐Ÿค”๐Ÿค”๐Ÿค”...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.