lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (LUCENENET-565) Port Lucene.Net.Replicator
Date Fri, 28 Jul 2017 15:29:00 GMT


ASF GitHub Bot commented on LUCENENET-565:

Github user AndyPook commented on the issue:
    Just sticking my 2p/2c in again...
    Having this as middleware with a ```UseLuceneReplicator("rootPrefix", service)``` would
be a lot more "natural" from an aspnetcore point of view.
    Part of the reason that the controller looks a little odd is due to the signature of ```Perform```.
It is odd to use the Request/Response properties in a Controller. In order to make the routing
work it also needs "{path*}" and the arg etc which is ignored cos it actually pulls those
direct from the Request.
    Looking at how Perform works, middleware taking control of the req/res at the owin layer
without all the mvc/routing shenanigans. Having it intercept a few path(s) (ie ```StartsWith(routprefix```)
would seem the "right thing to do". That way the developer can just add the middleware without
needing to get involved in creating a "weird" controller or messing with routing or thinking
about DI or...
    The MVC feature is just middleware after all.
    I think there may be an odd side effect if an exception occurs part way through. ie a
partial response with a json serialized exception added to the end which would be hard for
the client to deal with (although if this is how the java version works...). 
    Or if you think the Controller approach is better, I could imagine wrapping some of the
behavior in a custom ```IActionResult```. This could deal with handling the exception and
creating the right kind of http response. This would leave the ReplicationService with just
creating the stream.
    Might also be worth digging into how aspnetcore deals with big streams (ie does it buffer
them in memory before sending the first byte like old asp/iis did or can it do something smarter).
    Anyway, just some thoughts... what do you think?
    I ought to put my money where my mouth is, write some code and contribute :)
    I haven't used VS2015 in what seems like forever. We'll see what the weekend brings

> Port Lucene.Net.Replicator
> --------------------------
>                 Key: LUCENENET-565
>                 URL:
>             Project: Lucene.Net
>          Issue Type: Task
>          Components: Lucene.Net.Replicator
>    Affects Versions: Lucene.Net 4.8.0
>            Reporter: Shad Storhaug
>            Priority: Minor
>              Labels: features

This message was sent by Atlassian JIRA

View raw message