ThreadPoolExecutor和ArrayBlockingQueue(ThreadPoolExecutor and ArrayBlockingQueue)
对不起我的英语不好。 当池中的线程数增加到10以上时,该任务将被放置在ArrayBlockingQueue中。 但如果任务Callable? 构造函数ThreadPoolExecutor不接受TypeBlockingQueue类型为Callable。 那么,如何将任务添加到队列中?
ExecutorService executorService = new ThreadPoolExecutor(2, 10, 60L, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(100));
Excuse me for my bad english. When the number of threads in the pool to rise above 10, the the task will be placed in ArrayBlockingQueue . But if the task Callable? Constructor ThreadPoolExecutor not accept ArrayBlockingQueue typed as Callable. How, then, will be added to the queue the task?
ExecutorService executorService = new ThreadPoolExecutor(2, 10, 60L, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(100));
原文:https://stackoverflow.com/questions/28012298
最满意答案
只需右键单击项目视图中的文件夹,然后说出新的php文件。 那么只需在字段中输入file_name.ctp。
如果你有.ctp它不会添加.php
just right click on the folder in the project view, and then say new php file. then just type the file_name.ctp in the field.
if you have .ctp it will not add .php
相关问答
更多-
$this->render('/controller/view'); 您可以从任何控制器渲染任何视图,因此如果您想要创建一个“索引”视图并且其通用性足以让您传入$ data,则每次都可以呈现相同的视图。 您可以更进一步,在元素文件夹中创建该视图,以将其与控制器完全分离。 http://book.cakephp.org/view/980/render $this->render('/controller/view'); You can render any view from any controller ...
-
CakePHP 1.2引入了.ctp作为其视图的文件扩展名。 CakePHP视图文件用纯PHP编写,默认扩展名为.ctp(CakePHP Template) 。 这些文件包含从控制器获取数据所需的所有演示逻辑,其格式可供您投放的受众群体使用。 http://book.cakephp.org/2.0/en/views.html#view-templates CakePHP 1.2 introduced .ctp as its file extension for views. CakePHP view fil ...
-
这个答案指的是cakephp 2.4 I have been successfully using XML view files in CakePHP (request the XML output type in headers so CakePHP will use e.g. Orders/xml/create.ctp instead of Order/create.ctp). 在lib / Cake / View中,您可以看到不同的View文件,例如: View.php XmlView.php ...
-
我如何在NetBeans中创建一个新的CTP(CakePHP)文件?(How can I make a new CTP (CakePHP) file in NetBeans?)[2022-05-14]
只需右键单击项目视图中的文件夹,然后说出新的php文件。 那么只需在字段中输入file_name.ctp。 如果你有.ctp它不会添加.php just right click on the folder in the project view, and then say new php file. then just type the file_name.ctp in the field. if you have .ctp it will not add .php -
您应该更新phpDocumentor.ini文件的[_phpDocumentor_phpfile_exts]部分,以包含您希望phpDocumentor解析的任何其他文件扩展名。 You should update the [_phpDocumentor_phpfile_exts] section of your phpDocumentor.ini file to include any additional file extensions that you want phpDocumentor to pa ...
-
与WordPress API完美配合! 谢谢。 Works perfectly with the WordPress API! Thanks.
-
我从接受的答案中找到了Eclipse中CakePHP .ctp语法突出显示的解决方案,即“内容类型”标题下描述的内容。 Make sure you have set the correct editor associations and content types Go to settings (Window -> preferences) Content Types Type in Content Types in the search box (should show under General -> ...
-
执行视图中的代码,因为Cake使用include来处理它。 你可以自己做同样的事情: include('any_file_you_want.with_any_extension'); 只要有一个PHP开始标记并且语法正常,该文件中的任何代码都将被执行。 The code inside views is executed because Cake uses include to process it. You can do the same yourself: include('any_file_you_w ...
-
正确的方法是: $this->requestAction(array('controller' => 'users', 'action' => 'get_category')); the CakePHP way创建URL将提高性能(它不必使用Router)。 同样会一直工作,同时这样做:“users / get_category”可能会在你不在索引页面时造成一些麻烦。 它应该仅用于元素(特别是缓存),如果情况不同 - 请参考Travis Leleu在评论中写的内容。 The proper way to d ...
-
如何从CakePHP中的操作将变量设置为其他ctp文件?(How to set variable to other ctp file from an action in CakePHP?)[2022-05-09]
你需要最后调用$this->render('index') : - function OrderFromReseller($api_key) { $this->loadModel('Psetting'); $products = $this->Psetting->find('all'); $this->set(compact('products')); $this->render('index'); } render()告诉Cake生成View,因此模板不会考虑后面的任何内 ...