问题标签 [autoflush]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
254 浏览

stdout - perl6/rakudo:perl6 默认启用“自动刷新”吗?

perl6 默认情况下是否启用“自动刷新”。在没有启用“outflush”的情况下使用 perl5,我不会得到这种行为。

0 投票
2 回答
200 浏览

raku - perl6/rakudo:如何禁用自动刷新?

我试过这个,但没有奏效:

0 投票
2 回答
28183 浏览

php - 更新命令行输出,即进度

我希望能够在命令行上以简单的 PHP 脚本显示进度表。而不是看到

我只想更改数字,并替换以前的数字,就像 git clone 一样Resolving deltas: 100% (8522/8522), done.

在搜索这个时,我发现在 Perl 中回答了同样的问题,这是完美的,但我在 PHP 中找不到它。是否可以?如果没有,我将求助于 C。

谢谢

更新:如果有人对 C++ 版本感兴趣,请点击此处

0 投票
1 回答
718 浏览

hibernate - 为什么 Grails Searchable Plugin 会导致 Hibernate AutoFlush 出现错误?

在我尝试排除故障的Grails 1.2.5 项目中,我们使用 Grails Searchable 插件.5.5.1。

问题在于,每当我们尝试索引大型集合域类时,Grails 都会不断抛出:

ERROR hibernate.AssertionFailure - 发生断言失败(这可能表明 Hibernate 中存在错误,但更可能是由于会话使用不安全) org.hibernate.AssertionFailure:集合 [domain-class] 未由 flush() 处理

但是涉及的域类已经被hibernate映射和使用,除了对可搜索插件的调用之外没有问题。

可搜索插件的使用如下:

  1. 创建一个指南针会话compass.openSession()
  2. 开始罗盘交易:compassSession.beginTransaction()
  3. 然后compassSession.create(result.get(0))在一个重要的未索引域类上调用
  4. finallycompassTransaction.commit()被调用来提交事务。
  5. 转到 2 并处理下一个域类

在第 3 和第 4 个域类之间,触发了引发错误的自动刷新。

谁能给我有关如何解决此问题的任何提示?

有没有人遇到过这个问题?

我知道他们在可搜索插件的 0.5 之前版本中对此存在系统性问题。 这些问题可能没有完全解决吗?

0 投票
2 回答
3790 浏览

java - PrintWriter 自动刷新令人费解的逻辑

公共 PrintWriter(OutputStream out, boolean autoFlush)

公共 PrintStream(OutputStream out, boolean autoFlush)

在这些类之间更改自动刷新逻辑的原因是什么?

因为它们总是被认为是相同的,除了编码时刻和没有刷新的“自动刷新”print()几乎不符合最小惊讶原则,所以会出现一些愚蠢的错误:
我创建了一个开启自动刷新的 PrintWriter;为什么不自动刷新?

0 投票
1 回答
1937 浏览

hibernate - 集合不会持久化,因为 Spring-Webapp 将 Hibernate-Flush-Mode 设置为 Manual

我的 Spring-3.0.5/Hibernate-3.3.0 webapp 不存储集合。当创建一个带有关联集合的新持久化对象时,该对象会被持久化,但集合不会。在测试用例中一切正常,所以它不是错误的映射注释。

当我使用日志级别 TRACE 运行测试用例和 webapp 时,测试用例会产生类似 (grep for "[fF]lush":

但 webapp 只说:

当我抓住 vor "SessionImpl" 我得到

对于测试用例和

对于网络应用程序。

我不知道,为什么 webapp 总是禁用自动刷新!

这是我的 Webapp-Configuration(为清楚起见的缩写):

和我的资源定义:

0 投票
3 回答
225 浏览

perl - 为什么默认情况下不自动刷新缓冲区?

我最近有幸$| = 1;在我的 Perl 脚本中进行设置,以帮助它通过管道更快地与另一个应用程序通信。

我很好奇为什么这不是默认设置。换句话说,如果我的缓冲区被立即刷新,我会失去什么?

0 投票
1 回答
1598 浏览

jpa - JDBC 中的 EntityManger 刷新模式

JPA 本质上是 JDBC 的更高抽象。EntityManager 有一个 API setAutoFlushMode。它可以设置为 AUTO 或 COMMIT。用 JDBC 术语来说,这个等价物是什么?谢谢

0 投票
0 回答
379 浏览

php - PHP, implicit_flush: enable to run two instances of the same script in the same browser

I have a PHP script that uses implicit_flush() to output data when it's ready, the problem is that when I start two instances from Google chrome or Firefox the seconde instance remains loading without outputing anything!

To prevent locking issues with session files, I have turned Off session.auto_start in the php.ini file, and I added a session_write_close() at the begining of the script to be sure.

But if run the two instances on two differente browsers, the two work perfectly. If I run the second instance on an incognito mode in Chrome, it doesn't work.

Is the problem relative to the browser, the server, or router? Is there any solution to bypass this restriction?

Edit: because two instances run on two browser I think the only possibility is a browser problem.

0 投票
1 回答
400 浏览

java - Java:PrintStream 意外自动刷新

我期待这个程序获取一个数字列表,每行一个,然后当它达到零时,打印所有的正方形,每行一个。相反,它只是呼应我用方块输入的每个数字。

理想情况下,我实际上会包括以下行:

然后正常编写我的程序的其余部分(除了最后的刷新),但这具有立即回显的相同结果。

但是,将 更改PrintStream为 aPrintWriter确实可以按预期进行这项工作,但是我不能这样做,System.setOut因为PrintWriter不会扩展OutputStream.

为什么这不符合我的预期?