-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example notebook about concurrency, allow to install different fl…
…avors of akernel (#43)
- Loading branch information
1 parent
bcfdb76
commit 5e0e68f
Showing
4 changed files
with
133 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/bash | ||
|
||
python -m pip install -e . | ||
akernel install | ||
akernel install react |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "1424909b-49ae-4f63-938c-c72cb3f84550", | ||
"metadata": {}, | ||
"source": [ | ||
"If you execute the three following for-loops, you can see that they are executed concurrently." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "97b4a9c1-6818-404d-9e4f-64569dd9351f", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"__unchain_execution__()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "073b08dd-d004-4f94-8522-bfa1002c9694", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"for i in range(5):\n", | ||
" await asyncio.sleep(1)\n", | ||
" print(f\"{i=}\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "1ced9a54-9d08-4cb7-bd57-e68db9b1d7fb", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"for j in range(5):\n", | ||
" await asyncio.sleep(1)\n", | ||
" print(f\"{j=}\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "98e994bb-caa2-45f7-b35d-a183facb1b72", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"for k in range(5):\n", | ||
" await asyncio.sleep(1)\n", | ||
" print(f\"{k=}\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "558b8d22-d221-4ea8-bc25-e261ea491b7d", | ||
"metadata": {}, | ||
"source": [ | ||
"Now if you execute the three following for-loops, you can see that they are executed one after the other." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "422c2851-f7c8-460c-9544-13c9c8ebfe0b", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"__chain_execution__()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "21b5428c-9fcf-4150-af59-635deab42833", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"for i in range(5):\n", | ||
" await asyncio.sleep(1)\n", | ||
" print(f\"{i=}\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "5ee578b3-6b4d-4315-ab17-8c845d740b36", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"for j in range(5):\n", | ||
" await asyncio.sleep(1)\n", | ||
" print(f\"{j=}\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "16f0146a-fdf8-4fbe-bf37-63b2da2fe1e0", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"for k in range(5):\n", | ||
" await asyncio.sleep(1)\n", | ||
" print(f\"{k=}\")" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (akernel)", | ||
"language": "python", | ||
"name": "akernel" | ||
}, | ||
"language_info": { | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"version": "3.11.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters