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

Add ObjectPool<StringBuilder> to default services #652

Closed
wants to merge 2 commits into from

Conversation

dougbu
Copy link
Contributor

@dougbu dougbu commented Mar 15, 2016

nit: Fix incomplete test noted when adding new one

- can now use pooled `StringBuilder`s to address aspnet/HttpAbstractions#561 and similar issues

nit: Fix incomplete test noted when adding new one
@dougbu
Copy link
Contributor Author

dougbu commented Mar 15, 2016

/cc @Tratcher @muratg

}

[Fact]
public async Task ObjectPoolOfStringBuilderRegistered_EvenWhenStartupCtorThrows()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't actually care about ObjectPool in the StartupThrows scenario. You can find a simpler test to copy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions? I don't see much that just validates services are registered.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.Configure(app => { }) would be an adequate replacement for UseStartup in this test.

@Tratcher
Copy link
Member

Do not merge this until we see how aspnet/HttpAbstractions#561 looks.

@dougbu
Copy link
Contributor Author

dougbu commented Mar 15, 2016

🆙📅 and aspnet/HttpAbstractions#587 is out.

@Tratcher
Copy link
Member

@davidfowl Gag check?

@davidfowl
Copy link
Member

This is odd. I'm not sure this makes sense. Hosting isn't a dumping ground for arbitrary services like this....

@rynowak
Copy link
Member

rynowak commented Mar 16, 2016

@davidfowl - what do you propose? Use a static pool? That might make the most sense if we're talking about HttpAbstractions/WebUtilities

@davidfowl
Copy link
Member

Yes, I was going to suggest a static pool for something like this with optional overloads to pass in a pool into whatever method is there (low level method).

@dougbu
Copy link
Contributor Author

dougbu commented Mar 16, 2016

I was going to suggest a static pool

Let's discuss this offline. We already have at least one other pattern for ObjectPool<T> use in other repos. Would rather move ahead w/ the general guidance on when to use what (and what to use when) in place.

@dougbu
Copy link
Contributor Author

dougbu commented Mar 16, 2016

Will move instantiation of the pool to Kestrel as decided offline.

@dougbu dougbu closed this Mar 16, 2016
@dougbu dougbu deleted the dougbu/cookie.maker.561 branch March 19, 2016 19:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants