TCL:Windows中线程之间的双向通信(TCL: Two way communication between threads in Windows)
我需要在Tcl中的线程之间进行双向通信,而我所能得到的只是一种方式,参数传入作为我唯一的master-> helper通信通道。 这是我有的:
proc ExecProgram { command } { if { [catch {open "| $command" RDWR} fd ] } { # # Failed, return error indication # error "$fd" } }
要调用tclsh83,例如ExecProgram“tclsh83 testCases.tcl TestCase_01”
在testCases.tcl文件中,我可以使用传入的信息。 例如:
set myTestCase [lindex $argv 0]
在testCases.tcl中我可以输出到管道:
puts "$myTestCase" flush stdout
并使用进程ID接收放入主线程的内容:
gets $app line
......在一个循环中。
哪个不太好。 而不是双向的。
任何人都知道在两个线程之间的Windows中的tcl简单的双向通信方法?
I need to have two way communication between threads in Tcl and all I can get is one way with parameters passing in as my only master->helper communication channel. Here is what I have:
proc ExecProgram { command } { if { [catch {open "| $command" RDWR} fd ] } { # # Failed, return error indication # error "$fd" } }
To call the tclsh83, for example ExecProgram "tclsh83 testCases.tcl TestCase_01"
Within the testCases.tcl file I can use that passed in information. For example:
set myTestCase [lindex $argv 0]
Within testCases.tcl I can puts out to the pipe:
puts "$myTestCase" flush stdout
And receive that puts within the master thread by using the process ID:
gets $app line
...within a loop.
Which is not very good. And not two-way.
Anyone know of an easy 2-way communication method for tcl in Windows between 2 threads?
原文:https://stackoverflow.com/questions/267420
最满意答案
问题可能是返回TYPO3站点时未触发您的身份验证服务。 您的服务是否会触发取决于几个配置选项。 默认情况下,您的服务仅在POST登录操作发生时触发 - 但是有一些选项可以定义,例如,即使没有POST登录,身份验证服务也必须始终尝试获取(并因此验证)用户数据(相反,GET参数可用于确定是否应尝试身份验证)。
如果您打算使用此方法登录BE用户,还有一个警告。 我注意到,如果您尝试在FE中登录BE用户,则除非存在现有BE用户cookie(如果您已登录BE,它将会出现),则不会遵守任何操作或配置。 如果您使用身份验证服务通常登录到BE,则不存在此问题 - 仅当您尝试在FE中执行此操作时才适用。
TL; DR:我猜你需要使用此链接的“高级”部分中描述的参数为目标BE / FE上下文配置“always auth user”设置: https : //docs.typo3.org/ typo3cms / Typo3ServicesReference /验证/ index.html中
The problem was resolved creating a new plugin. In the configuration of application in Twitter I can not set parameters as controller and actions, for example; only the page id. I had to create a plugin in my TYPO3 extension that execute in one page the action for get information of callback, process and return the page with the list of social profiles. This We did it in each one social networks (Facebook, Google+ and Instagram) for their callback URL to be correct.
相关问答
更多-
您可以使用扩展名“extension_builder”。 它生成(骨架)基于extbase /流体的扩展,并与TYPO3 6.0兼容(甚至在生成的扩展中使用命名空间,这仅在6.0中引入)。 如果您想构建流媒体/扩展程序扩展,您应该阅读本书以熟悉这些扩展。 在德国,它也可以作为平装本。 我不确定“kickstarter”扩展是否仍然有效,但它的最后更新是一个维护版本,使其在TYPO3 v4.6中工作,所以它很有可能。 You can use the extension "extension_builder". ...
-
带有(twb)twitter bootstrap样式的typo3新闻扩展(typo3 news extension with (twb) twitter bootstrap styles)[2022-01-22]
我想你已经在https://docs.typo3.org/typo3cms/extensions/news/AdministratorManual/Templates/TwitterBootstrap/Index.html上看到了关于twitter bootstrap的手册。 订单应该是: 新闻 新闻TWB 您的sitepackage扩展程序 在常量的站点包扩展中,您可以覆盖常量 plugin.tx_news { view.twb { # cat=plugin.tx_news/fil ... -
最有可能的是,您需要在目标计算机上的Extenion Manager检索/更新扩展列表。 另外请记住,默认情况下,EM会选择随机镜像,因此如果您的分机在很久以前上传,则每个镜像可能需要一些时间。 另一方面... 如果只想在多个实例之间共享,只需将它在源计算机上导出到t3x文件,然后从文件导入,则无需将其发布到TER。 您也可以将整个扩展文件夹从源计算机的typo3conf/ext文件夹复制到目标计算机上的同一文件夹,然后它将处于与从repo下载的相同状态,但尚未安装。 Most probably you n ...
-
您获得的错误来自您尝试创建的存储库。 TYPO3\CMS\Extbase\Persistence\Repository有一个构造函数,它需要\TYPO3\CMS\Extbase\Object\ObjectManagerInterface作为参数。 由于您未在t3lib_div::makeInstance传递objectManager类,因此会引发错误。 您可以通过使用如下所示的依赖注入来避免这种情况。 /** * @var Tx_Mtclnt_Domain_Repository_AdsRepository ...
-
(更新以反映讨论的状态) 1138行应为: return $this->materials; (Updated to reflect state of discussion) Line 1138 should read: return $this->materials;
-
检查模板文件名的首字母大写。 规则是,对于名为fooBarAction()动作,模板文件必须命名为FooBar.html Check so template filename has first letter uppercase. The rule is that for action named fooBarAction() template file must be named FooBar.html
-
TYPO3:安排SQL语句(TYPO3: Schedule SQL statement)[2022-04-14]
有一个Scheduler,应该通过cronjob执行。 您可以从扩展中将自己的任务添加到调度程序,并定义应该执行的频率。 调度程序带有核心。 你可能需要安装它。 有关如何操作的更多信息: http://docs.typo3.org/typo3cms/extensions/scheduler/latest/DevelopersGuide/CreatingTasks/Index.html http://www.typo3lexikon.de/typo3-tutorials/extensions/schedule ... -
如何正确地在我的TYPO3扩展中回拨Twitter账号(How is correctly way to do callback of Twitter acount in my TYPO3 extension)[2022-10-24]
问题可能是返回TYPO3站点时未触发您的身份验证服务。 您的服务是否会触发取决于几个配置选项。 默认情况下,您的服务仅在POST登录操作发生时触发 - 但是有一些选项可以定义,例如,即使没有POST登录,身份验证服务也必须始终尝试获取(并因此验证)用户数据(相反,GET参数可用于确定是否应尝试身份验证)。 如果您打算使用此方法登录BE用户,还有一个警告。 我注意到,如果您尝试在FE中登录BE用户,则除非存在现有BE用户cookie(如果您已登录BE,它将会出现),则不会遵守任何操作或配置。 如果您使用身份验 ... -
是的,这似乎是一个只会影响谷歌Chrome的已知错误 。 我无法使用最新的Chrome(58.x)重现它。 所以我假设编辑使用谷歌Chrome并且尚未更新它? Yes, this seems to be a known bug that only affects Google Chrome. I Couldn't reproduce it with latest Chrome (58.x) though. So I assume the Editor uses Google Chrome and has y ...
-
也许你正在使用page.10.variables ? 在这里查看我的答案流体模板中typoscript的最佳用法是什么? Maybe you are using page.10.variables? Check my answer here what is the best usage of typoscript in fluid templates?