Comments (3)
I reproduce here what I said in the chat, for documentation:
https://gitter.im/Transient-Transient-Universe-HPlay/Lobby?at=59117b408a05641b116408cd
The applicative as is defined now, the operands have no buffers. That means that if one of the operands receive events faster than the other, the events of the first will be lost and only the values that are at the time the slower operand receive a value are returned
That may be fixed using Channels instead of IORefs in the Applicative instance. But I have to take a look.
There should have been four results in the applicative expression of above, but since events happens fast, the first operand has executed 1 and 2 before the second operand begins to execute, so the only two results have 2 in the first element o the tuple.
But using channels would be problematic . Unbounded channels would produce space leaks if one of the operands do not receive any events. bounded channels either can block or can reproduce the overruns that we already have
from transient.
Sorry the explanation is not correct. A buffer is not necessary since the result are generated at the frequency of the fastest operand. It's all because the events of the first operand are fired before the second operand of the applicative begin to execute. All the events that happens before the first result of the second operand are lost since the second operand is empty at this time.
That is less a problem than what I supposed, but it is harder to fix.
from transient.
I close this for the moment since the philosphy of transient is to return what happens right now, contrary to the philosophy of standard FRP, where recording everything is essential.
The other behaviour can be solved by using a transactional buffers, like Control.Concurrent.TChan or simply using threads 0
as prefix. This should avoid asynchronous thread, so the events will not be processed in parallel.
from transient.
Related Issues (20)
- Collect and group have inconsistent behavior in failure case HOT 2
- Issues with the logging API HOT 2
- threads primitive does not work as expected with logging HOT 2
- Unify exceptions and finalization primitives HOT 1
- Lost or silently ignored exceptions HOT 5
- Cannot use an untyped expression (e.g. error and throw) as the last expression HOT 1
- Inconsistent exception behavior HOT 6
- Use raw fork instead of forkIO HOT 1
- build failure: TypeRep not in scope HOT 3
- grouByTime not working as expecred HOT 2
- cabal file: stated homepage does not exist HOT 1
- Strange hang with applicative code HOT 2
- Different underlying transport HOT 4
- when a exception handler does not match with the exception type, the exception stop backtracking
- Fails to build with GHC 8.6.4 HOT 4
- callService shouldn't need a previous established connection to call services HOT 1
- Undesired parallelism HOT 2
- `threads` management under exception handlers HOT 3
- Network.BSD.getProtocolByName: does not exist (no such protocol name: tcp)
- Build failure with mtl-2.3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transient.