Commit Graph

19 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
bf2cf4dce5 Update the example facebook Haxl data source
Reviewed By: codemiller

Differential Revision: D8056786

fbshipit-source-id: a33a43be5f54691645c82d812a7d706265e9ed19
2018-06-22 06:09:02 -07:00
Simon Marlow
b31e7aaf4b Update facebook example readme.md
Reviewed By: codemiller

Differential Revision: D8179581

fbshipit-source-id: 658daf7b55f01242be7358ce263957eef4e6820c
2018-06-22 05:41:09 -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
Zejun Wu
9f873ed35a Update haxl copyright headers
Summary:
Update haxl copyright headers: s/2014/2014-present/g
Thank @siddharthasharma for pointing this out
Closes #26, #27

Test Plan: meh

Reviewed By: jon.coens@fb.com

Subscribers: ldbrandy, memo, watashi, smarlow, akr, bnitka, jcoens

FB internal diff: D1903841

Signature: t1:1903841:1426073797:b95462075265fa8ec9c1252e45ef5cac7a37e7e2
2015-03-11 12:42:01 -07:00
Konstantin Zudov
423709177b Added a note about the Prelude
It took me some time to figure out that I forgot about the Prelude. Hope that this will help someone.
2014-07-23 16:07:47 +03: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
Alessio Di Stasio
c562df2c46 Update readme.md 2014-06-10 20:52:00 -05:00
Simon Marlow
74a3874f0b Initial open source import 2014-06-10 02:47:59 -07:00