Show More
@@ -1058,6 +1058,61 b" where the first part is the zmq.IDENTITY of the heart's DEALER on the engine, an" | |||||
1058 | the rest is the message sent by the monitor. No Python code ever has any |
|
1058 | the rest is the message sent by the monitor. No Python code ever has any | |
1059 | access to the message between the monitor's send, and the monitor's recv. |
|
1059 | access to the message between the monitor's send, and the monitor's recv. | |
1060 |
|
1060 | |||
|
1061 | Widget Messages | |||
|
1062 | =============== | |||
|
1063 | ||||
|
1064 | IPython 2.0 adds interactive widgets, and a few messages associated with their management. | |||
|
1065 | ||||
|
1066 | .. versionadded:: 2.0 | |||
|
1067 | ||||
|
1068 | Widget Creation | |||
|
1069 | --------------- | |||
|
1070 | ||||
|
1071 | Creating a widget is always done on the Kernel side. | |||
|
1072 | Creating a widget produces a ``widget_create`` message on the IOPub channel:: | |||
|
1073 | ||||
|
1074 | { | |||
|
1075 | 'widget_id' : 'u-u-i-d', | |||
|
1076 | 'widget_type' : 'my_widget', | |||
|
1077 | 'data' : {} | |||
|
1078 | } | |||
|
1079 | ||||
|
1080 | Every widget has an ID and a type identifier (class). | |||
|
1081 | The ``data`` key can be any extra JSON information used in initialization of the widget. | |||
|
1082 | ||||
|
1083 | Updating Widgets | |||
|
1084 | ---------------- | |||
|
1085 | ||||
|
1086 | Widget updates are one-way communications to update widget state, | |||
|
1087 | either on the Kernel or the frontend side. Both sides can send these messages. | |||
|
1088 | ||||
|
1089 | Essentially, widgets define their own message specification implemented inside the ``data`` key. | |||
|
1090 | ||||
|
1091 | The kernel sends these messages on the IOPub channel, | |||
|
1092 | and the frontend sends them on the Shell channel. | |||
|
1093 | There are no expected replies (of course, one side can send another ``widget_update`` in reply). | |||
|
1094 | ||||
|
1095 | Message type: ``widget_update``:: | |||
|
1096 | ||||
|
1097 | { | |||
|
1098 | 'widget_id' : 'u-u-i-d', | |||
|
1099 | 'data' : {} | |||
|
1100 | } | |||
|
1101 | ||||
|
1102 | Tearing Down Widgets | |||
|
1103 | -------------------- | |||
|
1104 | ||||
|
1105 | Since widgets live on both sides, when a widget is destroyed the other side must be notified. | |||
|
1106 | This is done with a ``widget_destroy`` message, | |||
|
1107 | which can come from either side via IOPub or Shell. | |||
|
1108 | ||||
|
1109 | Message type: ``widget_destroy``:: | |||
|
1110 | ||||
|
1111 | { | |||
|
1112 | 'widget_id' : 'u-u-i-d', | |||
|
1113 | 'data' : {} | |||
|
1114 | } | |||
|
1115 | ||||
1061 |
|
|
1116 | ||
1062 | ToDo |
|
1117 | ToDo | |
1063 | ==== |
|
1118 | ==== | |
@@ -1070,9 +1125,4 b' Missing things include:' | |||||
1070 | likely that with the payload concept we can build a full solution, but not |
|
1125 | likely that with the payload concept we can build a full solution, but not | |
1071 | 100% clear yet. |
|
1126 | 100% clear yet. | |
1072 |
|
1127 | |||
1073 | * Finishing the details of the heartbeat protocol. |
|
|||
1074 |
|
||||
1075 | * Signal handling: specify what kind of information kernel should broadcast (or |
|
|||
1076 | not) when it receives signals. |
|
|||
1077 |
|
||||
1078 | .. include:: ../links.txt |
|
1128 | .. include:: ../links.txt |
General Comments 0
You need to be logged in to leave comments.
Login now