Revision | d51d8c0c3152560161150e420dfa3a31c79a8e40 (tree) |
---|---|
Time | 2020-03-24 18:51:39 |
Author | Albert Mietus < albert AT mietus DOT nl > |
Commiter | Albert Mietus < albert AT mietus DOT nl > |
PubSub: demo-slides updated (a bit more readble)
@@ -13315,7 +13315,8 @@ | ||
13315 | 13315 | <div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt"> |
13316 | 13316 | </div><div class="inner_cell"> |
13317 | 13317 | <div class="text_cell_render border-box-sizing rendered_html"> |
13318 | -<p>Notes: You can ignore <code>Topic.__init__()</code> and <code>Topic.__str__()</code> for now</p> | |
13318 | +<hr> | |
13319 | +<p>Note: You can ignore the dunder methods, <code>Topic.__init__()</code> and <code>Topic.__str__()</code> for now</p> | |
13319 | 13320 | |
13320 | 13321 | </div> |
13321 | 13322 | </div> |
@@ -13380,7 +13381,7 @@ | ||
13380 | 13381 | |
13381 | 13382 | |
13382 | 13383 | <div class="output_subarea output_stream output_stdout output_text"> |
13383 | -<pre>Demo:: Topic: <<Topic: 'demo 1' at 0X192e8f50888>> has new value: HOI | |
13384 | +<pre>Demo:: Topic: <<Topic: 'demo 1' at 0X1941ca82e88>> has new value: HOI | |
13384 | 13385 | </pre> |
13385 | 13386 | </div> |
13386 | 13387 | </div> |
@@ -13394,6 +13395,7 @@ | ||
13394 | 13395 | <div class="text_cell_render border-box-sizing rendered_html"> |
13395 | 13396 | <p><strong>Using</strong> a Topic is trivial:</p> |
13396 | 13397 | <p>Once a topic is created and a <em>callback</em> is registerd, that function is called whenever a new value is pubished.</p> |
13398 | +<p><code>topic.publish(data)</code> <strong><em>kind</em></strong> of act as <code>callback(data, topic)</code>, for all callbacks in a loop</p> | |
13397 | 13399 | |
13398 | 13400 | </div> |
13399 | 13401 | </div> |
@@ -13433,7 +13435,7 @@ | ||
13433 | 13435 | |
13434 | 13436 | |
13435 | 13437 | <div class="output_subarea output_stream output_stdout output_text"> |
13436 | -<pre>Demo:: Topic: <<Topic: 'demo 1' at 0X192e8f50888>> has new value: AGAIN | |
13438 | +<pre>Demo:: Topic: <<Topic: 'demo 1' at 0X1941ca82e88>> has new value: AGAIN | |
13437 | 13439 | </pre> |
13438 | 13440 | </div> |
13439 | 13441 | </div> |
@@ -13466,8 +13468,8 @@ | ||
13466 | 13468 | |
13467 | 13469 | |
13468 | 13470 | <div class="output_subarea output_stream output_stdout output_text"> |
13469 | -<pre>Demo:: Topic: <<Topic: 'demo 1' at 0X192e8f50888>> has new value: FORCE | |
13470 | -Demo:: Topic: <<Topic: 'demo 1' at 0X192e8f50888>> has new value: FORCE | |
13471 | +<pre>Demo:: Topic: <<Topic: 'demo 1' at 0X1941ca82e88>> has new value: FORCE | |
13472 | +Demo:: Topic: <<Topic: 'demo 1' at 0X1941ca82e88>> has new value: FORCE | |
13471 | 13473 | </pre> |
13472 | 13474 | </div> |
13473 | 13475 | </div> |
@@ -13500,8 +13502,8 @@ | ||
13500 | 13502 | |
13501 | 13503 | |
13502 | 13504 | <div class="output_subarea output_stream output_stdout output_text"> |
13503 | -<pre>Demo:: Topic: <<Topic: 'demo 1' at 0X192e8f50888>> has new value: SMART | |
13504 | -Demo:: Topic: <<Topic: 'demo 1' at 0X192e8f50888>> has new value: SMART | |
13505 | +<pre>Demo:: Topic: <<Topic: 'demo 1' at 0X1941ca82e88>> has new value: SMART | |
13506 | +Demo:: Topic: <<Topic: 'demo 1' at 0X1941ca82e88>> has new value: SMART | |
13505 | 13507 | </pre> |
13506 | 13508 | </div> |
13507 | 13509 | </div> |
@@ -13509,7 +13511,7 @@ | ||
13509 | 13511 | </div> |
13510 | 13512 | </div> |
13511 | 13513 | |
13512 | -</div> | |
13514 | +</div></section><section> | |
13513 | 13515 | <div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt"> |
13514 | 13516 | </div><div class="inner_cell"> |
13515 | 13517 | <div class="text_cell_render border-box-sizing rendered_html"> |
@@ -13540,7 +13542,7 @@ | ||
13540 | 13542 | |
13541 | 13543 | |
13542 | 13544 | <div class="output_subarea output_stream output_stdout output_text"> |
13543 | -<pre>Demo:: Topic: <<Topic: 'demo 1' at 0X192e8f50888>> has new value: I'm so smart | |
13545 | +<pre>Demo:: Topic: <<Topic: 'demo 1' at 0X1941ca82e88>> has new value: I'm so smart | |
13544 | 13546 | </pre> |
13545 | 13547 | </div> |
13546 | 13548 | </div> |
@@ -13573,7 +13575,7 @@ | ||
13573 | 13575 | |
13574 | 13576 | |
13575 | 13577 | <div class="output_subarea output_stream output_stdout output_text"> |
13576 | -<pre>Demo:: Topic: <<Topic: 'demo 1' at 0X192e8f50888>> has new value: As I call demo only once | |
13578 | +<pre>Demo:: Topic: <<Topic: 'demo 1' at 0X1941ca82e88>> has new value: As I call demo only once | |
13577 | 13579 | </pre> |
13578 | 13580 | </div> |
13579 | 13581 | </div> |
@@ -13667,10 +13669,10 @@ | ||
13667 | 13669 | |
13668 | 13670 | |
13669 | 13671 | <div class="output_subarea output_stream output_stdout output_text"> |
13670 | -<pre>Demo:: Topic: <<Topic: 'demo2' at 0X192e8f50508>> has new value: ALL | |
13671 | -Demo 2:: Topic: <<Topic: 'demo2' at 0X192e8f50508>> has new value: ALL | |
13672 | -Demo 3:: Topic: <<Topic: 'demo2' at 0X192e8f50508>> has new value: ALL | |
13673 | -Demo 4:: Topic: <<Topic: 'demo2' at 0X192e8f50508>> has new value: ALL | |
13672 | +<pre>Demo:: Topic: <<Topic: 'demo2' at 0X1941ca89848>> has new value: ALL | |
13673 | +Demo 2:: Topic: <<Topic: 'demo2' at 0X1941ca89848>> has new value: ALL | |
13674 | +Demo 3:: Topic: <<Topic: 'demo2' at 0X1941ca89848>> has new value: ALL | |
13675 | +Demo 4:: Topic: <<Topic: 'demo2' at 0X1941ca89848>> has new value: ALL | |
13674 | 13676 | </pre> |
13675 | 13677 | </div> |
13676 | 13678 | </div> |
@@ -13701,10 +13703,10 @@ | ||
13701 | 13703 | |
13702 | 13704 | |
13703 | 13705 | <div class="output_subarea output_stream output_stdout output_text"> |
13704 | -<pre>Demo:: Topic: <<Topic: 'demo2' at 0X192e8f50508>> has new value: again | |
13705 | -Demo 2:: Topic: <<Topic: 'demo2' at 0X192e8f50508>> has new value: again | |
13706 | -Demo 3:: Topic: <<Topic: 'demo2' at 0X192e8f50508>> has new value: again | |
13707 | -Demo 4:: Topic: <<Topic: 'demo2' at 0X192e8f50508>> has new value: again | |
13706 | +<pre>Demo:: Topic: <<Topic: 'demo2' at 0X1941ca89848>> has new value: again | |
13707 | +Demo 2:: Topic: <<Topic: 'demo2' at 0X1941ca89848>> has new value: again | |
13708 | +Demo 3:: Topic: <<Topic: 'demo2' at 0X1941ca89848>> has new value: again | |
13709 | +Demo 4:: Topic: <<Topic: 'demo2' at 0X1941ca89848>> has new value: again | |
13708 | 13710 | </pre> |
13709 | 13711 | </div> |
13710 | 13712 | </div> |
@@ -13740,8 +13742,8 @@ | ||
13740 | 13742 | <hr> |
13741 | 13743 | <p>Notes:</p> |
13742 | 13744 | <ul> |
13743 | -<li>Python will automatically remember the object (<code>self</code>)</li> | |
13744 | -<li>Here, we use a <em>trick</em> (<code>self._no</code>) to show the different instances</li> | |
13745 | +<li>Python will automatically remember the object (<code>self</code>).</li> | |
13746 | +<li>Here, we use a <em>trick</em> (<code>self._no</code>) to show (which of the) many instances are used.</li> | |
13745 | 13747 | </ul> |
13746 | 13748 | |
13747 | 13749 | </div> |
@@ -13771,6 +13773,15 @@ | ||
13771 | 13773 | </div> |
13772 | 13774 | </div> |
13773 | 13775 | |
13776 | +</div> | |
13777 | +<div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt"> | |
13778 | +</div><div class="inner_cell"> | |
13779 | +<div class="text_cell_render border-box-sizing rendered_html"> | |
13780 | +<hr> | |
13781 | +<p>Note: Again, you may ignore the dunder methods, <code>Demo.__init__()</code> and <code>``Demo.__str__()</code></p> | |
13782 | + | |
13783 | +</div> | |
13784 | +</div> | |
13774 | 13785 | </div></section><section> |
13775 | 13786 | <div class="cell border-box-sizing code_cell rendered"> |
13776 | 13787 | <div class="input"> |
@@ -13810,7 +13821,7 @@ | ||
13810 | 13821 | </div> |
13811 | 13822 | </div> |
13812 | 13823 | |
13813 | -</div></section><section> | |
13824 | +</div> | |
13814 | 13825 | <div class="cell border-box-sizing code_cell rendered"> |
13815 | 13826 | <div class="input"> |
13816 | 13827 | <div class="prompt input_prompt">In [20]:</div> |
@@ -13833,7 +13844,7 @@ | ||
13833 | 13844 | |
13834 | 13845 | |
13835 | 13846 | <div class="output_subarea output_stream output_stdout output_text"> |
13836 | -<pre><<Demo: ._no=0 at 0X192e8e2b588>> got 'class' from topic <<Topic: 'OO Demo' at 0X192e8e39d88>> | |
13847 | +<pre><<Demo: ._no=0 at 0X1941cadb588>> got 'class' from topic <<Topic: 'OO Demo' at 0X1941cad8348>> | |
13837 | 13848 | </pre> |
13838 | 13849 | </div> |
13839 | 13850 | </div> |
@@ -13906,20 +13917,20 @@ | ||
13906 | 13917 | |
13907 | 13918 | |
13908 | 13919 | <div class="output_subarea output_stream output_stdout output_text"> |
13909 | -<pre>Demo:: Topic: <<Topic: 'four-10-plys' at 0X192e8f67308>> has new value: Yes | |
13910 | -<<Demo: ._no=1 at 0X192e8f67348>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X192e8f67308>> | |
13911 | -<<Demo: ._no=2 at 0X192e8f67388>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X192e8f67308>> | |
13912 | -<<Demo: ._no=3 at 0X192e8f673c8>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X192e8f67308>> | |
13913 | -<<Demo: ._no=4 at 0X192e8f67408>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X192e8f67308>> | |
13914 | -<<Demo: ._no=5 at 0X192e8f67488>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X192e8f67308>> | |
13915 | -<<Demo: ._no=6 at 0X192e8f674c8>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X192e8f67308>> | |
13916 | -<<Demo: ._no=7 at 0X192e8f67508>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X192e8f67308>> | |
13917 | -<<Demo: ._no=8 at 0X192e8f67548>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X192e8f67308>> | |
13918 | -<<Demo: ._no=9 at 0X192e8f67448>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X192e8f67308>> | |
13919 | -<<Demo: ._no=10 at 0X192e8f675c8>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X192e8f67308>> | |
13920 | -Demo 4:: Topic: <<Topic: 'four-10-plys' at 0X192e8f67308>> has new value: Yes | |
13921 | -Demo 3:: Topic: <<Topic: 'four-10-plys' at 0X192e8f67308>> has new value: Yes | |
13922 | -Demo 2:: Topic: <<Topic: 'four-10-plys' at 0X192e8f67308>> has new value: Yes | |
13920 | +<pre>Demo:: Topic: <<Topic: 'four-10-plys' at 0X1941ca98e48>> has new value: Yes | |
13921 | +<<Demo: ._no=1 at 0X1941ca71e08>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X1941ca98e48>> | |
13922 | +<<Demo: ._no=2 at 0X1941ca71dc8>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X1941ca98e48>> | |
13923 | +<<Demo: ._no=3 at 0X1941ca82488>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X1941ca98e48>> | |
13924 | +<<Demo: ._no=4 at 0X1941ca82988>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X1941ca98e48>> | |
13925 | +<<Demo: ._no=5 at 0X1941ca82288>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X1941ca98e48>> | |
13926 | +<<Demo: ._no=6 at 0X1941cabf748>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X1941ca98e48>> | |
13927 | +<<Demo: ._no=7 at 0X1941cabf608>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X1941ca98e48>> | |
13928 | +<<Demo: ._no=8 at 0X1941cabf388>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X1941ca98e48>> | |
13929 | +<<Demo: ._no=9 at 0X1941ca82108>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X1941ca98e48>> | |
13930 | +<<Demo: ._no=10 at 0X1941cabf048>> got 'Yes' from topic <<Topic: 'four-10-plys' at 0X1941ca98e48>> | |
13931 | +Demo 4:: Topic: <<Topic: 'four-10-plys' at 0X1941ca98e48>> has new value: Yes | |
13932 | +Demo 3:: Topic: <<Topic: 'four-10-plys' at 0X1941ca98e48>> has new value: Yes | |
13933 | +Demo 2:: Topic: <<Topic: 'four-10-plys' at 0X1941ca98e48>> has new value: Yes | |
13923 | 13934 | </pre> |
13924 | 13935 | </div> |
13925 | 13936 | </div> |
@@ -13959,7 +13970,7 @@ | ||
13959 | 13970 | |
13960 | 13971 | |
13961 | 13972 | <div class="output_subarea output_stream output_stdout output_text"> |
13962 | -<pre>Demo:: Topic: <<Topic: '' at 0X192e8f5e248>> has new value: fist | |
13973 | +<pre>Demo:: Topic: <<Topic: '' at 0X1941cabf4c8>> has new value: fist | |
13963 | 13974 | </pre> |
13964 | 13975 | </div> |
13965 | 13976 | </div> |
@@ -14004,8 +14015,8 @@ | ||
14004 | 14015 | |
14005 | 14016 | |
14006 | 14017 | <div class="output_subarea output_stream output_stdout output_text"> |
14007 | -<pre>Demo:: Topic: <<Topic: '' at 0X192e8f5e248>> has new value: more and more | |
14008 | -Demo 2:: Topic: <<Topic: '' at 0X192e8f5e248>> has new value: more and more | |
14018 | +<pre>Demo:: Topic: <<Topic: '' at 0X1941cabf4c8>> has new value: more and more | |
14019 | +Demo 2:: Topic: <<Topic: '' at 0X1941cabf4c8>> has new value: more and more | |
14009 | 14020 | </pre> |
14010 | 14021 | </div> |
14011 | 14022 | </div> |
@@ -14017,13 +14028,13 @@ | ||
14017 | 14028 | <div class="cell border-box-sizing text_cell rendered"><div class="prompt input_prompt"> |
14018 | 14029 | </div><div class="inner_cell"> |
14019 | 14030 | <div class="text_cell_render border-box-sizing rendered_html"> |
14020 | -<p><img src="https://upload.wikimedia.org/wikipedia/commons/e/ea/Thats_all_folks.svg" alt="From WikiMedia"></p> | |
14021 | 14031 | <p>Back to the |
14022 | 14032 | <a href="http://mess.softwarebetermaken.nl/en/latest/SoftwareCompetence/DesignWorkShops/PubSub/index.html">main presentation</a></p> |
14023 | - | |
14024 | -</div> | |
14025 | -</div> | |
14026 | -</div> | |
14033 | +<p><img src="https://upload.wikimedia.org/wikipedia/commons/e/ea/Thats_all_folks.svg" alt="From WikiMedia"></p> | |
14034 | + | |
14035 | +</div> | |
14036 | +</div> | |
14037 | +</div></section><section> | |
14027 | 14038 | <div class="cell border-box-sizing code_cell rendered"> |
14028 | 14039 | <div class="input"> |
14029 | 14040 | <div class="prompt input_prompt">In [26]:</div> |
@@ -14048,7 +14059,7 @@ | ||
14048 | 14059 | |
14049 | 14060 | |
14050 | 14061 | <div class="output_subarea output_stream output_stdout output_text"> |
14051 | -<pre>These slides are generated at: 2020-03-22 14:15:38.809070+01:00 | |
14062 | +<pre>These slides are generated at: 2020-03-24 10:24:17.362544+01:00 | |
14052 | 14063 | </pre> |
14053 | 14064 | </div> |
14054 | 14065 | </div> |