New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a truly async model pipeline work for WebApi publisher. #322

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@rayao
Contributor

rayao commented Mar 14, 2016

A truly async model pipeline leads to unsuccessful routing registration. We didn't see this in our existing samples because their model pipelines are synchronous in nature.
This change tries to defer the actual RESTier routing setup until the model pipeline returns. Before that, requests run on a placeholder routing.

@rayao

This comment has been minimized.

Contributor

rayao commented Mar 14, 2016

batchHandler.ApiFactory = apiFactory;
}
var pathHandler = new DefaultODataPathHandler();
////defaultODataPathHandler.ResolverSetttings = config.GetResolverSettings();

This comment has been minimized.

@rayao

rayao Mar 14, 2016

Contributor

ResolverSettings is an internal member, must find a way to set it if no other convenient API.

var conventions = ODataRoutingConventions.CreateDefault();
Placeholder = new ODataPathRouteConstraint(pathHandler, new EdmModel(), routeName, conventions);
ApiFactory = apiFactory;
Task.Delay(5000).ContinueWith(_ => TryInitModel());

This comment has been minimized.

@rayao

rayao Mar 14, 2016

Contributor

Sorry the Delay is for testing, to make the pipeline truly async. It's not required.

@rayao

This comment has been minimized.

Contributor

rayao commented Mar 14, 2016

I'm not quite sure if we should go this way. Another option is to force the model pipeline synchronous.

@lewischeng-ms

This comment has been minimized.

Contributor

lewischeng-ms commented Mar 15, 2016

@rayao, based on our offline discussion, please change the PR accordingly and merge. Thanks!

@rayao rayao closed this Mar 15, 2016

@rayao rayao deleted the rayao:model branch Mar 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment