Skip to content
This repository was archived by the owner on Dec 25, 2019. It is now read-only.
This repository was archived by the owner on Dec 25, 2019. It is now read-only.

Thread Safety & Static Route handling #1

@JKamsker

Description

@JKamsker

Hey,
I've noticed that the Method collection is a simple list which is NOT thread safe. Using it in a multithreaded application (==Task.Run) can result in weird behaviour which could potentially destroy the process.
I suggest moving to a collection from System.Collections.Concurrent or using an access lock object and locking it with "lock(object){}". You should pay attention to deadlocks.

Another thing which i noticed is that the Route class is static which isnt optimal. There are 2 reasons which came to my mind:

  1. Testability. You will have a hard time Unit Testing your application.
  2. Multiple server instances with different behaviours are not possible with the current approach.

I hope you find those suggestion helpful

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions