-
Notifications
You must be signed in to change notification settings - Fork 79
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
Shareable executors #616
Shareable executors #616
Changes from all commits
ab795dd
674b4a4
33807ed
f8fbd50
ac7a829
f25db3f
7cab45b
80caa81
194e516
3eb7b54
452a62f
0fe6ae0
e3f1542
2b1d11c
83ba726
1949da6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
Copyright (C) 2013-2020 Expedia Inc. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package com.hotels.styx; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
|
||
/** | ||
* A generic factory that can be implemented to create executor objects whose type is not known | ||
* until read from configuration. | ||
* | ||
*/ | ||
public interface ExecutorFactory { | ||
/** | ||
* Create an executor instance. | ||
* | ||
* @param name Executor name | ||
* @param configuration Styx executor configuration | ||
* | ||
* @return Styx service instance | ||
*/ | ||
NettyExecutor create(String name, JsonNode configuration); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we try not to not pass a JsonNode here? It seems we keep propagating our Yaml based config. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code follows the idiomatic fashion of creating styx objects from yaml/json nodes. Sadly the styx object model relies entirely on yaml and/or JsonNode based configuration. I have created a a proof of concept that lifts this restriction. Check the details in PR: #609 (Remove old application router). Till then, it needs to stay in this "idiomatic" form. |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is clearing the interrupted flag, we've discussed previously it might not be the best option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. A good catch :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.