{"id":128781,"date":"2018-12-28T08:51:59","date_gmt":"2018-12-28T00:51:59","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=128781"},"modified":"2018-11-26T10:55:23","modified_gmt":"2018-11-26T02:55:23","slug":"kotlin-ktor1","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/kotlin-ktor1.html","title":{"rendered":"Kotlin \u5f00\u59cb\u5e03\u5c40\u8fdb\u653bweb\u5f00\u53d1\uff1aKtor 1.0 \u53d1\u5e03\uff0c\u4e00\u6b3e Kotlin Web \u6846\u67b6"},"content":{"rendered":"
Ktor 1.0 \u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u8fd9\u662f\u4e00\u4e2a\u7531 Kotlin \u56e2\u961f\u6253\u9020\u7684 Web \u6846\u67b6\uff01\u53ef\u7528\u4e8e\u521b\u5efa\u5f02\u6b65\u3001\u9ad8\u6027\u80fd\u548c\u8f7b\u91cf\u7ea7\u7684 Web \u670d\u52a1\u5668\uff0c\u5e76\u4f7f\u7528 Kotlin \u60ef\u7528\u7684 API \u6784\u5efa\u975e\u963b\u585e\u7684\u591a\u5e73\u53f0 Web \u5ba2\u6237\u7aef\u3002<\/p>\n
Ktor \u662f\u4e00\u4e2a\u7528\u4e8e\u5728\u8fde\u63a5\u7cfb\u7edf(connected systems)\u4e2d\u6784\u5efa\u5f02\u6b65\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\u7684 Kotlin \u6846\u67b6\u3002\u5b83\u7531 Kotlin \u56e2\u961f\u521b\u5efa\uff0c\u4e5f\u662f\u5c5e\u4e8e JetBrains \u7684\u9879\u76ee\u3002\u56e0\u6b64\uff0c\u5b83\u5145\u5206\u5229\u7528\u4e86 Kotlin \u7684\u8bed\u8a00\u7279\u6027\uff0c\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u51fa\u8272\u7684\u4f53\u9a8c\u548c\u8fd0\u884c\u65f6\u6027\u80fd\u3002<\/p>\n
<\/p>\n
Ktor \u4f7f\u7528\u534f\u7a0b\u4ece\u5934\u5f00\u59cb\u6784\u5efa\uff0c\u8fd9\u610f\u5473\u7740\u53ef\u8868\u8fbe\u590d\u6742\u7684\u5f02\u6b65\u6784\u9020(asynchronous constructs)\uff0c\u534f\u7a0b\u5728\u8fd0\u884c\u65f6\u73af\u5883\u4e5f\u975e\u5e38\u9ad8\u6548\u3002\u6b64\u5916\uff0c\u4f7f\u7528 Kotlin \u7684\u8bed\u8a00\u7279\u6027\u5141\u8bb8\u4f7f\u7528\u8005\u63d0\u4f9b\u9886\u57df\u7279\u5b9a\u8bed\u8a00(DSL) \u2014\u2014 \u4e00\u79cd\u7b80\u6d01\u4e14\u6613\u4e8e\u5f00\u53d1\u8005\u4f7f\u7528\u7684 API\uff0c\u53ea\u9700\u4ee3\u7801\u5373\u53ef\u7528\u4e8e\u914d\u7f6e\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u3002
\n<\/p>\n
\u5f53\u7136\uff0cKtor \u4e0d\u662f\u5728 Kotlin \u4e2d\u6784\u5efa\u670d\u52a1\u5668\u7aef\u5e94\u7528\u7a0b\u5e8f\u7684\u552f\u4e00\u9009\u62e9\u3002\u5176\u4ed6\u6846\u67b6\u5982 Spring \u548c Vert.x \u90fd\u4e3a Kotlin \u63d0\u4f9b\u4e86\u4e00\u6d41\u7684\u652f\u6301\uff0c\u4f7f\u7528\u8fd9\u4e9b\u6846\u67b6\u662f\u4fdd\u62a4\u73b0\u6709\u6295\u5165\u548c\u5f00\u53d1\u4f53\u9a8c\u7684\u597d\u65b9\u6cd5\u3002\u4e0e\u6b64\u540c\u65f6\uff0c\u7531\u4e8e\u4f7f\u7528\u4e86\u534f\u7a0b\u548c DSL\uff0cKtor \u63d0\u4f9b\u4e86\u72ec\u7279\u7684\u4f18\u52bf\uff0c\u8fd9\u4f7f\u5f97\u5b83\u5728\u4f60\u5f00\u59cb\u65b0\u7684\u540e\u7aef\u9879\u76ee\u6216\u5fae\u670d\u52a1\u65f6\u6210\u4e3a\u4e00\u4e2a\u5f88\u597d\u7684\u9009\u62e9\u3002<\/p>\n
\u6309\u7167\u5b98\u65b9\u7684\u8bf4\u6cd5\uff0cKtor \u5df2\u7ecf\u5728\u5927\u89c4\u6a21\u8fd0\u8425\u7684\u8bb8\u591a\u9879\u76ee\u4e2d\u6295\u5165\u751f\u4ea7\u4f7f\u7528\u3002\u4f8b\u5982\uff0cHLTV.org \u6bcf\u6708\u63d0\u4f9b\u5927\u7ea62\u4ebf\u6b21\u7efc\u5408\u6d4f\u89c8\u91cf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
Ktor 1.0 \u5df2\u6b63\u5f0f\u53d1\u5e03\uff0c\u8fd9\u662f\u4e00\u4e2a\u7531 Kotlin \u56e2\u961f\u6253\u9020\u7684 Web \u6846\u67b6\uff01\u53ef\u7528\u4e8e\u521b\u5efa\u5f02\u6b65\u3001\u9ad8\u6027\u80fd\u548c\u8f7b\u91cf […]<\/p>\n","protected":false},"author":63,"featured_media":99953,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-128781","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/128781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=128781"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/128781\/revisions"}],"predecessor-version":[{"id":129005,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/128781\/revisions\/129005"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/99953"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=128781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=128781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=128781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}