Last active
December 10, 2017 11:19
-
-
Save antimon2/6944d60c126939b6704aa594466770be to your computer and use it in GitHub Desktop.
ChannelSamples.ipynb
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
{ | |
"cells": [ | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "## ズンドコキヨシ" | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2017-12-10T20:08:06.769000+09:00", | |
"start_time": "2017-12-10T11:08:05.823Z" | |
}, | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "function zundokochannel()\n function _producer(channel::Channel{String})\n i = 1\n while i > 0\n zd, i = rand([(\"ズン\", i + 1), (\"ドコ\", +(i<5))])\n put!(channel, zd)\n end\n put!(channel, \"キ・ヨ・シ!\")\n close(channel)\n end\n channel = Channel{String}(32)\n @schedule _producer(channel)\n channel\nend", | |
"execution_count": 1, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "zundokochannel (generic function with 1 method)" | |
}, | |
"execution_count": 1, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2017-12-10T20:08:07.688000+09:00", | |
"start_time": "2017-12-10T11:08:07.457Z" | |
}, | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "for cw in zundokochannel()\n print(cw)\nend", | |
"execution_count": 2, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": "ズンドコズンズンドコドコドコドコドコドコドコドコドコドコズンズンドコドコズンズンズンズンズンドコキ・ヨ・シ!" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2017-12-10T20:08:08.963000+09:00", | |
"start_time": "2017-12-10T11:08:08.299Z" | |
}, | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "collect(zundokochannel())", | |
"execution_count": 3, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "82-element Array{String,1}:\n \"ドコ\" \n \"ズン\" \n \"ズン\" \n \"ドコ\" \n \"ドコ\" \n \"ズン\" \n \"ドコ\" \n \"ズン\" \n \"ズン\" \n \"ドコ\" \n \"ズン\" \n \"ズン\" \n \"ドコ\" \n ⋮ \n \"ドコ\" \n \"ドコ\" \n \"ドコ\" \n \"ズン\" \n \"ドコ\" \n \"ズン\" \n \"ズン\" \n \"ズン\" \n \"ズン\" \n \"ズン\" \n \"ドコ\" \n \"キ・ヨ・シ!\"" | |
}, | |
"execution_count": 3, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "### ズンドコキヨシ(厳密版)" | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "refer-to: https://qiita.com/antimon2/items/b198076666b40c72cece#20160317-2020-%E8%BF%BD%E8%A8%98%E5%8E%B3%E5%AF%86%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3" | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2017-12-10T20:08:33.054000+09:00", | |
"start_time": "2017-12-10T11:08:33.047Z" | |
}, | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "function zundokostrictchannel()\n function _producer(channel::Channel{String})\n i = 1\n while i > 0\n zd, i = rand([(\"ズン\", i + 1), (\"ドコ\", +(i!=5))])\n put!(channel, zd)\n end\n put!(channel, \"キ・ヨ・シ!\")\n close(channel)\n end\n channel = Channel{String}(32)\n @schedule _producer(channel)\n channel\nend", | |
"execution_count": 4, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "zundokostrictchannel (generic function with 1 method)" | |
}, | |
"execution_count": 4, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2017-12-10T20:08:34.061000+09:00", | |
"start_time": "2017-12-10T11:08:34.039Z" | |
}, | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "for cw in zundokostrictchannel()\n print(cw)\nend", | |
"execution_count": 5, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": "ズンドコズンドコドコドコズンドコドコズンズンドコドコドコドコドコズンドコドコドコズンズンドコズンズンドコズンズンズンズンドコキ・ヨ・シ!" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2017-12-10T20:08:34.834000+09:00", | |
"start_time": "2017-12-10T11:08:34.830Z" | |
}, | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "collect(zundokostrictchannel())", | |
"execution_count": 6, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "51-element Array{String,1}:\n \"ズン\" \n \"ドコ\" \n \"ズン\" \n \"ズン\" \n \"ドコ\" \n \"ドコ\" \n \"ドコ\" \n \"ズン\" \n \"ズン\" \n \"ズン\" \n \"ズン\" \n \"ズン\" \n \"ドコ\" \n ⋮ \n \"ドコ\" \n \"ドコ\" \n \"ドコ\" \n \"ドコ\" \n \"ズン\" \n \"ドコ\" \n \"ズン\" \n \"ズン\" \n \"ズン\" \n \"ズン\" \n \"ドコ\" \n \"キ・ヨ・シ!\"" | |
}, | |
"execution_count": 6, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "### ズンドコキヨシ(for v0.6.x)" | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2017-12-10T20:08:40.011000+09:00", | |
"start_time": "2017-12-10T11:08:39.812Z" | |
}, | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "VERSION", | |
"execution_count": 7, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "v\"0.6.1\"" | |
}, | |
"execution_count": 7, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2017-12-10T20:08:43.794000+09:00", | |
"start_time": "2017-12-10T11:08:43.788Z" | |
}, | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "function zundokochannel_v06()\n Channel(ctype=String, csize=32) do channel::Channel{String}\n i = 1\n while i > 0\n zd, i = rand([(\"ズン\", i + 1), (\"ドコ\", +(i<5))])\n put!(channel, zd)\n end\n put!(channel, \"キ・ヨ・シ!\")\n end\nend", | |
"execution_count": 8, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "zundokochannel_v06 (generic function with 1 method)" | |
}, | |
"execution_count": 8, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2017-12-10T20:08:45.443000+09:00", | |
"start_time": "2017-12-10T11:08:45.266Z" | |
}, | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "for cw in zundokochannel_v06()\n print(cw)\nend", | |
"execution_count": 9, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": "ズンズンドコドコドコドコズンズンドコドコズンドコドコズンズンズンズンドコキ・ヨ・シ!" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2017-12-10T20:08:46.177000+09:00", | |
"start_time": "2017-12-10T11:08:46.170Z" | |
}, | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "collect(zundokochannel_v06())", | |
"execution_count": 10, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "27-element Array{String,1}:\n \"ドコ\" \n \"ドコ\" \n \"ドコ\" \n \"ズン\" \n \"ズン\" \n \"ドコ\" \n \"ズン\" \n \"ドコ\" \n \"ドコ\" \n \"ズン\" \n \"ドコ\" \n \"ズン\" \n \"ズン\" \n ⋮ \n \"ズン\" \n \"ドコ\" \n \"ドコ\" \n \"ドコ\" \n \"ドコ\" \n \"ズン\" \n \"ズン\" \n \"ズン\" \n \"ズン\" \n \"ズン\" \n \"ドコ\" \n \"キ・ヨ・シ!\"" | |
}, | |
"execution_count": 10, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "### 参考:ズンドコキヨシ(Task Iteration)" | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2017-12-10T20:08:49.666000+09:00", | |
"start_time": "2017-12-10T11:08:49.657Z" | |
}, | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "function zundokotask()\n function _producer()\n i = 1\n while i > 0\n zd, i = rand([(\"ズン\", i + 1), (\"ドコ\", +(i<5))])\n produce(zd)\n end\n produce(\"キ・ヨ・シ!\")\n end\n @task _producer()\nend", | |
"execution_count": 11, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": "zundokotask (generic function with 1 method)" | |
}, | |
"execution_count": 11, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2017-12-10T20:08:52.087000+09:00", | |
"start_time": "2017-12-10T11:08:51.116Z" | |
}, | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "for cw in zundokotask()\n print(cw)\nend", | |
"execution_count": 12, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": "\u001b[1m\u001b[33mWARNING: \u001b[39m\u001b[22m\u001b[33mTask iteration is now deprecated. Use Channels for inter-task communication. A for-loop on a Channel object is terminated by calling `close` on the object.\u001b[39m\nStacktrace:\n [1] \u001b[1mdepwarn\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String, ::Symbol\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:70\u001b[22m\u001b[22m\n [2] \u001b[1mstart\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:986\u001b[22m\u001b[22m [inlined]\n [3] \u001b[1manonymous\u001b[22m\u001b[22m at \u001b[1m./<missing>:?\u001b[22m\u001b[22m\n [4] \u001b[1minclude_string\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String, ::String\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./loading.jl:522\u001b[22m\u001b[22m\n [5] \u001b[1minclude_string\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::Module, ::String, ::String\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m/path/to/userhome/.julia/v0.6/Compat/src/Compat.jl:174\u001b[22m\u001b[22m\n [6] \u001b[1mexecute_request\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::ZMQ.Socket, ::IJulia.Msg\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m/path/to/userhome/.julia/v0.6/IJulia/src/execute_request.jl:154\u001b[22m\u001b[22m\n [7] \u001b[1meventloop\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::ZMQ.Socket\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m/path/to/userhome/.julia/v0.6/IJulia/src/eventloop.jl:8\u001b[22m\u001b[22m\n [8] \u001b[1m(::IJulia.##14#17)\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./task.jl:335\u001b[22m\u001b[22m\nwhile loading In[12], in expression starting on line 1\n\u001b[1m\u001b[33mWARNING: \u001b[39m\u001b[22m\u001b[33mconsume is now deprecated. Use Channels for inter-task communication.\u001b[39m\nStacktrace:\n [1] \u001b[1mdepwarn\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String, ::Symbol\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:70\u001b[22m\u001b[22m\n [2] \u001b[1mconsume\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::Task\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:955\u001b[22m\u001b[22m\n [3] \u001b[1mdone\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:992\u001b[22m\u001b[22m [inlined]\n [4] \u001b[1manonymous\u001b[22m\u001b[22m at \u001b[1m./<missing>:?\u001b[22m\u001b[22m\n [5] \u001b[1minclude_string\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String, ::String\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./loading.jl:522\u001b[22m\u001b[22m\n [6] \u001b[1minclude_string\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::Module, ::String, ::String\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m/path/to/userhome/.julia/v0.6/Compat/src/Compat.jl:174\u001b[22m\u001b[22m\n [7] \u001b[1mexecute_request\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::ZMQ.Socket, ::IJulia.Msg\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m/path/to/userhome/.julia/v0.6/IJulia/src/execute_request.jl:154\u001b[22m\u001b[22m\n [8] \u001b[1meventloop\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::ZMQ.Socket\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m/path/to/userhome/.julia/v0.6/IJulia/src/eventloop.jl:8\u001b[22m\u001b[22m\n [9] \u001b[1m(::IJulia.##14#17)\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./task.jl:335\u001b[22m\u001b[22m\nwhile loading In[12], in expression starting on line 1\n" | |
}, | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": "ドコズンドコドコドコドコズンズンドコドコドコドコドコズンズンズンドコズンズンズンズンズンズンズンズンズンズンドコキ・ヨ・シ!" | |
}, | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": "\u001b[1m\u001b[33mWARNING: \u001b[39m\u001b[22m\u001b[33mproduce is now deprecated. Use Channels for inter-task communication.\u001b[39m\nStacktrace:\n [1] \u001b[1mdepwarn\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String, ::Symbol\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:70\u001b[22m\u001b[22m\n [2] \u001b[1mproduce\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:909\u001b[22m\u001b[22m\n [3] \u001b[1m(::#_producer#10)\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./In[11]:6\u001b[22m\u001b[22m\n [4] \u001b[1m(::##9#11{#_producer#10})\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./task.jl:80\u001b[22m\u001b[22m\nwhile loading In[12], in expression starting on line 1\n\u001b[1m\u001b[33mWARNING: \u001b[39m\u001b[22m\u001b[33mproduce is now deprecated. Use Channels for inter-task communication.\u001b[39m\nStacktrace:\n [1] \u001b[1mdepwarn\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String, ::Symbol\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:70\u001b[22m\u001b[22m\n [2] \u001b[1mproduce\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:909\u001b[22m\u001b[22m\n [3] \u001b[1m(::#_producer#10)\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./In[11]:8\u001b[22m\u001b[22m\n [4] \u001b[1m(::##9#11{#_producer#10})\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./task.jl:80\u001b[22m\u001b[22m\nwhile loading In[12], in expression starting on line 1\n" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"end_time": "2017-12-10T20:08:53.238000+09:00", | |
"start_time": "2017-12-10T11:08:53.108Z" | |
}, | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "collect(zundokotask())", | |
"execution_count": 13, | |
"outputs": [ | |
{ | |
"name": "stderr", | |
"output_type": "stream", | |
"text": "\u001b[1m\u001b[33mWARNING: \u001b[39m\u001b[22m\u001b[33mTask iteration is now deprecated. Use Channels for inter-task communication. A for-loop on a Channel object is terminated by calling `close` on the object.\u001b[39m\nStacktrace:\n [1] \u001b[1mdepwarn\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String, ::Symbol\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:70\u001b[22m\u001b[22m\n [2] \u001b[1mstart\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:986\u001b[22m\u001b[22m [inlined]\n [3] \u001b[1mgrow_to!\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::Array{Any,1}, ::Task\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./array.jl:525\u001b[22m\u001b[22m\n [4] \u001b[1mcollect\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::Task\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./array.jl:431\u001b[22m\u001b[22m\n [5] \u001b[1minclude_string\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String, ::String\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./loading.jl:522\u001b[22m\u001b[22m\n [6] \u001b[1minclude_string\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::Module, ::String, ::String\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m/path/to/userhome/.julia/v0.6/Compat/src/Compat.jl:174\u001b[22m\u001b[22m\n [7] \u001b[1mexecute_request\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::ZMQ.Socket, ::IJulia.Msg\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m/path/to/userhome/.julia/v0.6/IJulia/src/execute_request.jl:154\u001b[22m\u001b[22m\n [8] \u001b[1meventloop\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::ZMQ.Socket\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m/path/to/userhome/.julia/v0.6/IJulia/src/eventloop.jl:8\u001b[22m\u001b[22m\n [9] \u001b[1m(::IJulia.##14#17)\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./task.jl:335\u001b[22m\u001b[22m\nwhile loading In[13], in expression starting on line 1\n\u001b[1m\u001b[33mWARNING: \u001b[39m\u001b[22m\u001b[33mconsume is now deprecated. Use Channels for inter-task communication.\u001b[39m\nStacktrace:\n [1] \u001b[1mdepwarn\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String, ::Symbol\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:70\u001b[22m\u001b[22m\n [2] \u001b[1mconsume\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::Task\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:955\u001b[22m\u001b[22m\n [3] \u001b[1mdone\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:992\u001b[22m\u001b[22m [inlined]\n [4] \u001b[1mgrow_to!\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::Array{Union{},1}, ::Task, ::Void\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./array.jl:531\u001b[22m\u001b[22m\n [5] \u001b[1mgrow_to!\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::Array{Any,1}, ::Task\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./array.jl:525\u001b[22m\u001b[22m\n [6] \u001b[1mcollect\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::Task\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./array.jl:431\u001b[22m\u001b[22m\n [7] \u001b[1minclude_string\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String, ::String\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./loading.jl:522\u001b[22m\u001b[22m\n [8] \u001b[1minclude_string\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::Module, ::String, ::String\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m/path/to/userhome/.julia/v0.6/Compat/src/Compat.jl:174\u001b[22m\u001b[22m\n [9] \u001b[1mexecute_request\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::ZMQ.Socket, ::IJulia.Msg\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m/path/to/userhome/.julia/v0.6/IJulia/src/execute_request.jl:154\u001b[22m\u001b[22m\n [10] \u001b[1meventloop\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::ZMQ.Socket\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m/path/to/userhome/.julia/v0.6/IJulia/src/eventloop.jl:8\u001b[22m\u001b[22m\n [11] \u001b[1m(::IJulia.##14#17)\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./task.jl:335\u001b[22m\u001b[22m\nwhile loading In[13], in expression starting on line 1\n\u001b[1m\u001b[33mWARNING: \u001b[39m\u001b[22m\u001b[33mproduce is now deprecated. Use Channels for inter-task communication.\u001b[39m\nStacktrace:\n [1] \u001b[1mdepwarn\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String, ::Symbol\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:70\u001b[22m\u001b[22m\n [2] \u001b[1mproduce\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:909\u001b[22m\u001b[22m\n [3] \u001b[1m(::#_producer#10)\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./In[11]:6\u001b[22m\u001b[22m\n [4] \u001b[1m(::##9#11{#_producer#10})\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./task.jl:80\u001b[22m\u001b[22m\nwhile loading In[13], in expression starting on line 1\n\u001b[1m\u001b[33mWARNING: \u001b[39m\u001b[22m\u001b[33mproduce is now deprecated. Use Channels for inter-task communication.\u001b[39m\nStacktrace:\n [1] \u001b[1mdepwarn\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String, ::Symbol\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:70\u001b[22m\u001b[22m\n [2] \u001b[1mproduce\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m::String\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./deprecated.jl:909\u001b[22m\u001b[22m\n [3] \u001b[1m(::#_producer#10)\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./In[11]:8\u001b[22m\u001b[22m\n [4] \u001b[1m(::##9#11{#_producer#10})\u001b[22m\u001b[22m\u001b[1m(\u001b[22m\u001b[22m\u001b[1m)\u001b[22m\u001b[22m at \u001b[1m./task.jl:80\u001b[22m\u001b[22m\nwhile loading In[13], in expression starting on line 1\n" | |
}, | |
{ | |
"data": { | |
"text/plain": "19-element Array{String,1}:\n \"ドコ\" \n \"ドコ\" \n \"ズン\" \n \"ドコ\" \n \"ドコ\" \n \"ドコ\" \n \"ドコ\" \n \"ドコ\" \n \"ドコ\" \n \"ズン\" \n \"ズン\" \n \"ドコ\" \n \"ドコ\" \n \"ズン\" \n \"ズン\" \n \"ズン\" \n \"ズン\" \n \"ドコ\" \n \"キ・ヨ・シ!\"" | |
}, | |
"execution_count": 13, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": false | |
}, | |
"cell_type": "code", | |
"source": "", | |
"execution_count": null, | |
"outputs": [] | |
} | |
], | |
"metadata": { | |
"_draft": { | |
"nbviewer_url": "https://gist.github.com/6944d60c126939b6704aa594466770be" | |
}, | |
"gist": { | |
"id": "6944d60c126939b6704aa594466770be", | |
"data": { | |
"description": "ChannelSamples.ipynb", | |
"public": true | |
} | |
}, | |
"kernelspec": { | |
"name": "julia-0.6", | |
"display_name": "Julia 0.6.1", | |
"language": "julia" | |
}, | |
"language_info": { | |
"file_extension": ".jl", | |
"name": "julia", | |
"mimetype": "application/julia", | |
"version": "0.6.1" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment