Skip to content

Commit

Permalink
Merge pull request #126 from StackStorm/cpu-friendly
Browse files Browse the repository at this point in the history
Add sleep in while loop of composer to yield cpu
  • Loading branch information
m4dcoder authored Feb 7, 2019
2 parents 5da6295 + d52f076 commit 774123b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions orquesta/composers/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import eventlet
import logging
from six.moves import queue

Expand Down Expand Up @@ -224,4 +225,7 @@ def _create_task_ex_name(task_name, split_id):
ref=prev_seq[3]['ref']
)

# Add sleep here to yield to other threads/processes.
eventlet.sleep(0.001)

return wf_ex_graph
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
chardet
eventlet
Jinja2>=2.8 # BSD License (3 clause)
jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT
networkx>=1.10,<2.0
Expand Down

0 comments on commit 774123b

Please sign in to comment.