Comments (3)
I think when I wrote the common network code I still believed the story that unsafePerformIO
is immoral.
This looks like a great solution. Passing the manager around is overkill for something that should be session-based global state. If you're running a bot, working for hundreds of hours, then your solution above makes perfect sense.
from bitx.hs.
Actually, you know, I think it was because my mental model of Haskell evaluation was incorrect at the time. I thought GHC would share globalManager
after evaluating it once, like it does for pure values! Of course, that's obviously wrong, once you understand RealWorld#
and all that jazz.
Embarrassing mistake!
Please go ahead and make the change. ;-)
from bitx.hs.
I guess we can always introduce APIs that take an explicit manager later if there's a need. I thought about this some more and now I agree with you; I think the only advantages of being able to pass an explicit manager in are:
- Cleaning the manager up early: unlikely to be relevant since you are probably making requests throughout the entire lifetime of your process.
- Controlling connection sharing / reuse; also unlikely to be relevant, due to how the Luno API enforces limits.
- Fiddling with other connection settings: setting a proxy server, adjusting connection timeouts, etc. This might be relevant, but is somewhat esoteric, so we can probably wait for somebody to show up with an actual need for it before worrying about it.
from bitx.hs.
Related Issues (11)
- bitx-bitcoin-0.2.0.0 does not compile HOT 13
- Parsing empty trades response fails
- Ticker values need to be `Scientific` HOT 9
- Could not find module โNetworkโ
- Precision issue
- CI is totally buggered HOT 4
- Travis jobs randomly run into 503 issues
- Stackage nightly test failure HOT 9
- ETHXBT pair HOT 1
- Streaming API HOT 4
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 bitx.hs.