{"id":32,"date":"2014-08-23T23:24:28","date_gmt":"2014-08-23T15:24:28","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=32"},"modified":"2014-11-29T17:50:47","modified_gmt":"2014-11-29T09:50:47","slug":"qworker%e6%8a%80%e5%b7%a7%e4%b9%8b%e5%8f%82%e6%95%b0%e5%8c%96","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=32","title":{"rendered":"QWorker\u6280\u5de7\u4e4b\u53c2\u6570\u5316"},"content":{"rendered":"<p style=\"color: #454545;\">QWorker\u672c\u8eab\u53ea\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9644\u52a0\u7684Data\u6210\u5458\u6765\u8ba9\u7528\u6237\u4f20\u9012\u989d\u5916\u7684\u6570\u636e\uff0c\u800cData\u662f\u4e00\u4e2aPointer\uff0c\u8fd9\u5c31\u51b3\u5b9a\u4e86\u5b83\u53ef\u4ee5\u5141\u8bb8\u7528\u6237\u968f\u610f\u63a7\u5236\u4f20\u5165\u7684\u5185\u5bb9\u3002\u4f46\u5c31\u8c61\u6240\u6709\u7684\u5f02\u6b65\u8fc7\u7a0b\u4e00\u6837\uff0c\u4f20\u5165\u7684\u5185\u5b58\u5757\u5982\u679c\u662f\u4ece\u5806\u4e2d\u4e34\u65f6\u7533\u8bf7\u7684\uff0c\u90a3\u4e48\u5b83\u5c31\u5b58\u5728\u4e00\u4e2a\u91ca\u653e\u7684\u95ee\u9898\uff0c\u8c01\u6765\u8d1f\u8d23\u91ca\u653e\uff0c\u600e\u4e48\u53bb\u91ca\u653e\uff1f<\/p>\n<p style=\"color: #454545;\">QWorker\u60f3\u5230\u4e86\u8fd9\u4e00\u4e2a\u95ee\u9898\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4e0d\u9519\u7684\u89e3\u51b3\u65b9\u6848\uff1a\u7531QWorker\u672c\u8eab\u8d1f\u8d23\u5728\u6b63\u786e\u7684\u65f6\u95f4\u91ca\u653e\u3002<\/p>\n<p style=\"color: #454545;\">Data\u6210\u5458\u6b63\u5e38\u7684\u7c7b\u578b\u4e00\u822c\u662f\u7ed3\u6784\u4f53\u3001\u5bf9\u8c61\u548c\u63a5\u53e3\uff0cQWorker\u7684\u5404\u4e2a\u51fd\u6570\u63d0\u4f9b\u4e86\u4e00\u4e2aAFreeType\u53c2\u6570\uff0c\u6765\u544a\u8bc9QWorker\u5982\u4f55\u53bb\u91ca\u653eData\u6307\u9488\u6307\u5411\u7684\u5185\u5bb9\u3002<\/p>\n<p style=\"color: #454545;\">jdfFreeByUser : \u7528\u6237\u7ba1\u7406\u5bf9\u8c61\u7684\u91ca\u653e\uff0c\u9ed8\u8ba4\u662f\u8fd9\u4e2a<\/p>\n<p style=\"color: #454545;\">jdfFreeAsObject : \u9644\u52a0\u7684\u662f\u4e00\u4e2aTObject\u7ee7\u627f\u7684\u5bf9\u8c61\uff0c\u4f5c\u4e1a\u5b8c\u6210\u65f6\u4f1a\u8c03\u7528FreeObject\u91ca\u653e<\/p>\n<p style=\"color: #454545;\">jdfFreeAsSimpleRecord : \u9644\u52a0\u7684\u662f\u4e00\u4e2aRecord\u5bf9\u8c61\uff0c\u4f5c\u4e1a\u5b8c\u6210\u65f6\u4f1a\u8c03\u7528Dispose\u91ca\u653e<\/p>\n<p style=\"color: #454545;\">jdfFreeAsInterface : \u9644\u52a0\u7684\u662f\u4e00\u4e2a\u63a5\u53e3\u5bf9\u8c61\uff0c\u6dfb\u52a0\u65f6\u4f1a\u589e\u52a0\u8ba1\u6570\uff0c\u4f5c\u4e1a\u5b8c\u6210\u65f6\u4f1a\u51cf\u5c11\u8ba1\u6570<\/p>\n<p style=\"color: #454545;\">jdfFreeAsC1~jdfFreeAsC6:\u7528\u6237\u81ea\u5b9a\u4e49\u7684\u91ca\u653e\u65b9\u5f0f\uff0c\u7528\u4e8e\u652f\u6301\u9664\u4e0a\u8ff0\u65b9\u5f0f\u5916\u7684\u5176\u5b83\u65b9\u5f0f<\/p>\n<p style=\"color: #454545;\">\u00a0 \u00a0\u4e0b\u9762\u662f\u4e00\u4e2a\u6f14\u793a\u7684\u4ee3\u7801\uff1a<\/p>\n<pre class=\"lang:delphi decode:true \" title=\"\u4f7f\u7528QMsgPack\u5bf9\u8c61\u4f5c\u4e3a\u4f5c\u4e1a\u53c2\u6570\">...\r\n\r\n\u00a0 \u00a0 uses qmsgpack;\r\n\r\n\u00a0 \u00a0 ...\r\n\r\n\u00a0 \u00a0\u00a0AMsgPack:=TQMsgPack.Create;\r\n\r\n\u00a0\u00a0\u00a0\u00a0AMsgPack.Add('Name','\u53c2\u6570\u6837\u5f0f2');\r\n\r\n\u00a0\u00a0\u00a0\u00a0AMsgPack.Add('Id',101);\r\n\r\n\u00a0\u00a0\u00a0\u00a0Workers.Post(DoMsgPackJob,\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 AMsgPack,\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 True,jdfFreeAsObject\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 );<\/pre>\n<p>\u5176\u4e2d\u7684AMsgPack\u53c2\u6570\u5728\u4f5c\u4e1a\u5b8c\u6210\u6216\u8005\u88ab\u53d6\u6d88\u65f6\uff0c\u4f1a\u81ea\u52a8\u88ab\u91ca\u653e\uff0c\u800c\u4e0d\u7528\u62c5\u5fc3\u5185\u5b58\u6cc4\u9732\u3002<\/p>\n<p>QWorker\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2aTQJobExtData\u7c7b\u578b\u6765\u7b80\u5316\u53c2\u6570\u7684\u4f20\u9012\u64cd\u4f5c\uff0c\u5177\u4f53\u76f8\u5173\u7684\u8bf4\u660e\uff0c\u8bf7\u53c2\u8003\uff1a<a href=\"https:\/\/blog.qdac.cc\/?p=1018\" target=\"_blank\">QWorker\u66f4\u65b0-\u65b0\u589e\u57fa\u4e8e\u4f5c\u4e1a\u8fc7\u7a0b\u7684\u521d\u59cb\u5316\u548c\u91ca\u653e\u65b9\u6cd5<\/a>\uff0c\u901a\u8fc7\u4f7f\u7528\u57fa\u4e8e\u4f5c\u4e1a\u8fc7\u7a0b\u7684\u521d\u59cb\u5316\u548c\u81ea\u52a8\u91ca\u653e\u65b9\u6cd5\uff0c\u53ef\u4ee5\u66f4\u597d\u7684\u5904\u7406\u53c2\u6570\u4f20\u9012\u7684\u95ee\u9898\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>QWorker\u672c\u8eab\u53ea\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9644\u52a0\u7684Da [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[6],"tags":[85,86],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-qworker","tag-85","tag-86"],"views":6526,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=32"}],"version-history":[{"count":6,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":1352,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/32\/revisions\/1352"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}