Commit Graph

14 Commits

Author SHA1 Message Date
Anubhav Bindlish
dc6eeb46ef Fix haxl core tests
Summary:
Expose a conveniece wrapper `runHaxlWithWrites` which returns the writes along with
the result of the `Haxl` computation.

Reviewed By: simonmar

Differential Revision: D14386668

fbshipit-source-id: 95757916691f7b9b1291c7dceae7eafe8738cfca
2019-04-10 09:48:57 -07:00
Anubhav Bindlish
70f5bad436 Add writes to IORef in Env
Summary:
Here I try to populate the writes done as part of a Haxl computation
in an IORef inside the Environment.

`IVar` which is the synchornisation point,
also acts as the point where we store intermediate writes for Haxl
computations, so they can be memoized and reused whenever a memoized
computation is done again. This is done inside `getIVarWithWrites` function.

This works, because we create new IVars when running a memo computation
or a data fetch, and it is only at these places where we need to create a new
environment with empty writes to run the computation in. So I run every memoized
computation in a new environment (with empty writes) and populate the writes in this new
environment. At the end of the memoized computation, I look up these writes from the `IVar`
and also add them to the original environment. This way ultimately all writes are correctly
propagated upwards to the top level environment user passes to `runHaxl`.
This logic lives inside `execMemoNow`.

Reviewed By: simonmar

Differential Revision: D14342181

fbshipit-source-id: a410dae1a477f27b480804b67b2212e7500997ab
2019-04-10 09:48:57 -07:00
Simon Marlow
b67f7f6370 Haxl 2
Summary:
This is a complete reworking of the way that Haxl schedules I/O.  The
main benefits are:

* Data fetches are no longer organised into rounds, but can be
  arbitrarily overlapped with each other and with computation.  The
  scheduler supports an arbitrary queue of work items which it can
  evaluate while data-fetching is taking place in the background.  To
  take advantage of this, data sources must implement a new form of
  `PerformFetch`, namely `BackgroundFetch`.  The old forms of
  `PerformFetch` are still supported, but won't benefit from any
  additional concurrency.

* It is now possible to specify on a per-data-source basis whether
  fetching should be optimised for batching or for latency.  A request
  to a data source that doesn't benefit from batching can be submitted
  immediately.  This is done with the new `schedulerHint` method of
  `DataSource`.

Reviewed By: niteria

Differential Revision: D4938005

fbshipit-source-id: 96f12ad05ee62d62474ee4cc1215f19d0a6fcdf3
2017-10-03 00:28:54 -07:00
Oleg Grenrus
b0a5f7b8a8 Rename Show1 to ShowP
Summary:
Resolve #62
Closes https://github.com/facebook/Haxl/pull/63

Reviewed By: JonCoens

Differential Revision: D4299180

Pulled By: niteria

fbshipit-source-id: 0bcbefd26184d1e7ad5de99a806ce0cf4b57d1a6
2016-12-09 14:31:39 -08:00
Gergely Szilvasy
3e78756034 Remove TARGETS files 2016-05-27 08:22:40 -07:00
Simon Marlow
0f9ca4ea00 More warning-freedom with GHC 7.10
Test Plan: built it with GHC 7.10

Reviewed By: watashi@fb.com

Subscribers: anfarmer, kjm, jlengyel, watashi, smarlow, akr, bnitka, jcoens

FB internal diff: D2494818

Tasks: 6005053

Signature: t1:2494818:1443642397:d59465c015a7ea8baf69243bdc8c48056fb52c29
2015-10-07 01:16:32 -07:00
Jens Petersen
53cf6095fa replace getAllUsers by getAllUserIds 2014-06-23 14:00:53 +09:00
Simon Marlow
da1525d897 Sync the readme.md with the code
Summary: from PR 4

Test Plan: unit tests

Reviewed By: akr@fb.com

Subscribers: ldbrandy, jonp, smarlow, akr, bnitka, jcoens

FB internal diff: D1384640
2014-06-16 06:48:51 -07:00
Simon Marlow
610e7d2a10 Merge pull request #8 from ChristopherBiscardi/sql-example-fix
Small SQL example .cabal fixes
2014-06-16 11:59:02 +01:00
Simon Marlow
4a9540d7fb Merge pull request #6 from 23Skidoo/patch-1
Missing annotation for a code snippet.
2014-06-15 16:31:02 +01:00
Christopher Biscardi
45a25e4b3b Small SQL example .cabal fixes
When building from a fresh sandbox in /example/sql, cabal complained
about the name and version fields missing, as well as the base
dependency missing in build-depends.
2014-06-13 22:16:59 -07:00
ravenjohn
c6b8410a8c Update readme.md 2014-06-14 06:46:49 +08:00
Mikhail Glushenkov
1ad000e8d7 Missing annotation for a code snippet. 2014-06-11 15:02:15 +02:00
Simon Marlow
74a3874f0b Initial open source import 2014-06-10 02:47:59 -07:00