Summary:
The problem was that we could lose the correct Env if a continuation
got blocked and restarted.
Reviewed By: niteria
Differential Revision: D5985280
fbshipit-source-id: f8afdb9d4db38781b33a8bddde46c031a133dec1
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
Summary:
Restricted version of cachedComputation, useful for abusing
memoization for mocking functions.
Reviewed By: niteria
Differential Revision: D5861480
fbshipit-source-id: c3978bb675e260591bb99b7dd2219775a9422907
Summary:
We need a release for GHC 8.2.1 compatibility:
https://github.com/facebook/Haxl/issues/70
(Note: this ignores all push blocking failures!)
Reviewed By: simonmar
Differential Revision: D5488485
fbshipit-source-id: 61ae115e7456beb1dd8855d387690e13a1e09bdc
Summary:
Build with eventlog is enabled was broken by refactoring, this should fix
it.
Reviewed By: xich
Differential Revision: D5410539
fbshipit-source-id: fd2dc97d9d853bcd6bc4b322c3995eec765227eb
Summary: Bump to a more recent stackage-lts
Reviewed By: niteria
Differential Revision: D5257292
fbshipit-source-id: 8f3aa86c699e6b91d55998d03dab0d0440993317
Summary: This provides a way to override test file locations for other build systems.
Reviewed By: yfeldblum
Differential Revision: D5218507
fbshipit-source-id: 7087ca13afb105b727ecf3f7dfdaecd26d27ea81
Summary:
It doesn't exist in GHC 8.2 and it appears that
Data.Typeable just works.
This should fix https://github.com/facebook/Haxl/issues/70.
Differential Revision: D5086644
fbshipit-source-id: e3e48ea7d603bbdf4fd78b4acd5125761ce799b2
Summary: text prior to 1.2.1.0 doesn't work because we need the Binary instance
Reviewed By: niteria
Differential Revision: D5027630
fbshipit-source-id: d6eeefb40a19ae2c0aaccaad868dc42ed4976ea5
Summary: Adds a simple `stack` file using the latest version of stackage.
Reviewed By: watashi
Differential Revision: D4843970
fbshipit-source-id: 938a16de769210661064157084f5eac42c7c0494
Summary:
- `binary-0.9` is accidental major jump and is now deprecated, I'm not sure what's best to do, cabal solver should pick `-0.8.x.y.` version
- `HUnit` and `time` changes do not affect use in haxl.
Closes https://github.com/facebook/Haxl/pull/68
Differential Revision: D4843906
Pulled By: JonCoens
fbshipit-source-id: b97c78e644a170745d7a29aab5c137e86f7018be
Summary:
These two operators are subtly non-deterministic, but can potentially
improve performance significantly in cases where
* We don't want to use .|| because it's too sequential
* We don't want to use || because it forces us to do wasted work
(and equivalently for &&).
The implementation is a bit subtle, see Note [tricky pOr/pAnd]
Reviewed By: xich
Differential Revision: D4611809
fbshipit-source-id: 832ace29dfc44e48c14cc5d4f52a0114ee326c92
Summary:
I didn't look into this too deeply but I'm guessing it was because the
constant expression had been lifted out, so I made it not a constant
expression.
Reviewed By: JonCoens
Differential Revision: D4521430
fbshipit-source-id: 687075d8486b38743b3bd8b9a9f26aa198b2d258
Summary:
If this goes ok, can we have a release?
Closes https://github.com/facebook/Haxl/pull/66
Reviewed By: simonmar
Differential Revision: D4409114
Pulled By: niteria
fbshipit-source-id: 6d6e88f1cf7b9ae2d851eaa86966f2eb417b4d7e
Summary:
Alternatively we could change dependency to `aeson-compat`, which has less major version bumps (because it has smaller public API surface, yet one have to be careful .e.g. not to rely on instance implementations).
Closes https://github.com/facebook/Haxl/pull/64
Differential Revision: D4385525
Pulled By: xich
fbshipit-source-id: 72246e0f9144728e618de7bfcf983531bd3d281a
Summary:
Include request in the uninitialized data source error so we will
know which request is not in cache or triggering this problem.
This will increase the size of error message, but in production
this should not happen as we should sanitize data source is
initizlied correctly.
Reviewed By: codemiller
Differential Revision: D4342674
fbshipit-source-id: ec3506285806e749dccade5ba5eb8cfdb25a5671
Summary: `GenHaxl` having an `NFData` instance is apparently a lie. Remove this functionality
Reviewed By: simonmar
Differential Revision: D3967290
fbshipit-source-id: 1da91dcd6470de0f911e8a29b86c4aa5d6c7301f
Summary: Some of the test files were not listed in haxl.cabal
Reviewed By: kuk0
Differential Revision: D3951346
fbshipit-source-id: 8e6677a728acde3713c618a6383b2de510b1ac86
Summary: Having an NFData instance allows forcing calls that return a Haxl computation to run.
Reviewed By: xich
Differential Revision: D3906781
fbshipit-source-id: e49448152695383031af6d315a20dbcd1c10720c
Summary:
Labels which throw Haxl exceptions are recorded, but pure exceptions bubble up
and labels are lost. This test demonstrates this.
Reviewed By: simonmar
Differential Revision: D3672479
fbshipit-source-id: fab10878e7eb067e0c65bcf401d75604c333007f
Summary: Prior to GHC 7.10, <$> was not in the prelude, so requires an explicit import.
Reviewed By: watashi
Differential Revision: D3656379
fbshipit-source-id: 43925bc9c483ee712b04976d6fa6cb6b9d9b998e
Summary:
The 7.8 build keeps breaking, but no one notices until someone opens an issue.
With the travis badge, breakage will at least be visible from the github
landing page for Haxl repo.
Reviewed By: zilberstein
Differential Revision: D3656468
fbshipit-source-id: 5537ab78b9dd44a5a3f07e7e3db7f73ec959f096
Summary: Expose MiddleException because the `eName` function is useful.
Reviewed By: watashi
Differential Revision: D3635507
fbshipit-source-id: bec3fac0b4f7c009c57d14857d46576ffc5ab826
Summary:
This revision generalizes the existing memoization framework to 1-ary and 2-ary
functions (namely functions of type (a -> GenHaxl u b) and (a -> b _> GenHaxl u c)).
For every support arity (currently 0, 1, and 2), a family of functions {
newMemoWithX, prepareMemoX and runMemoX } are provided. newMemo itself is
generic across all arities.
Reviewed By: simonmar
Differential Revision: D3555791
fbshipit-source-id: 010a9889d42327607c8b03a5f7a609ee0c70de49
Summary:
This revision refactors cachedComputation to only contain logic relevant to
where the request-scope memo lives; memo creation and running logic is delegated
to newMemo(with) and runMemo.
Comments in cachedComputation have been moved over to newMemo/runMemo, and a
benchmark for cachedComputation has been added to monadbench. Surprisingly,
performance might have improved, albeit very slightly.
Reviewed By: simonmar
Differential Revision: D3514791
fbshipit-source-id: b2f0627824adc79b766e4f4e28c4af957ff00a00
Summary: This diff collects the stack traces of `dataFetch` calls, when `reportLevel` >= 5 and profiling is on. Zero overhead for non-profiled code.
Reviewed By: niteria
Differential Revision: D2535947
fbshipit-source-id: fd43c20edd5455bd5e41113059fc69206b998e44
Summary:
This diff adds the createMemo and updateMemo helper functions, which abstract
the memoization reference management logic of cachedComputation. This separates
the work of *how* a memoized computation is created/updated, from *where* the
memo reference lives, allowing the same code to be used to manage request-scope
and feature-scope memos simultaneously.
A refactor of cachedComputation to use this abstraction is forthcoming.
Reviewed By: simonmar
Differential Revision: D3492803
fbshipit-source-id: 9dadd3860d5bec3bf776eef7c1bd610c25283729
Summary: Track and report allocation usage for data sources and rounds
Reviewed By: simonmar
Differential Revision: D3488169
fbshipit-source-id: 39c853ec89881e9f7d8d32b1a8d0a878c847a33e