Finally, hxbolts

  1. Why hxbolts?
  2. Trying promhx
  3. Trying thx.promise
  4. Trying task
  5. Trying continuation
  6. Trying async
  7. Trying hext-flow
  8. Finally, hxbolts

And finally, I’ll make the same task using hxbolts (few words about – it is pure haxe port of java library Bolts, which itself seems to be inspired by Task Parallel Library from dotNET).

TL;DR – 🙂 Strongly typed, easy to use. Without all this async / await magic, but predictable and well tested.

Continue reading

Trying hext-flow

  1. Why hxbolts?
  2. Trying promhx
  3. Trying thx.promise
  4. Trying task
  5. Trying continuation
  6. Trying async
  7. Trying hext-flow
  8. Finally, hxbolts

Today I will try to use hext-flow. Unfortunately version from haxelib don’t work anymore, so I used version from github instead (both hext-flow and hext-core).

TL;DR – 🙁 Has no ability to chain promises, resolved and rejected values must be of the same type, promise can be resolved outside of creator function.

Continue reading

Trying async

  1. Why hxbolts?
  2. Trying promhx
  3. Trying thx.promise
  4. Trying task
  5. Trying continuation
  6. Trying async
  7. Trying hext-flow
  8. Finally, hxbolts

This library is somehow similar to continuation – it use haxe macro magic to be able to use C#-like async / await. Only 94 haxelib downloads and 27 github stars, I think this lib need more attention. Okay… Click… Press… Voila, 28 github stars 🙂 I will use version from github, however my code should work (I hope) with version from haxelib.

TL;DR – 🙂 Works like a charm. Still need some polishing, but can be used right now.

Continue reading

Trying task

  1. Why hxbolts?
  2. Trying promhx
  3. Trying thx.promise
  4. Trying task
  5. Trying continuation
  6. Trying async
  7. Trying hext-flow
  8. Finally, hxbolts

This library hasn’t been updated for 2 years, and it seems that it’s designed for other purposes and not for those for whom I was trying to use it. Anyway, let’s try, because this lib (v1.0.6) has incredible haxelib downloads – 11586 (wow!).

TL;DR – 🙁 As I thought, it is designed for other purposes, and can’t be used as Promises.

Continue reading

Why hxbolts?

  1. Why hxbolts?
  2. Trying promhx
  3. Trying thx.promise
  4. Trying task
  5. Trying continuation
  6. Trying async
  7. Trying hext-flow
  8. Finally, hxbolts

Seriously, there are numerous promise / async libraries for haxe, why we need another one? In series of posts I will try to do the same task using different libraries.

Important note: I’m open to discussions on twitter or in comments here.

At first let’s find these libraries

Library must be cross platform – at least swf, js, cpp and neko. I go to the lib.haxe.org and enter “promise” into the search box:

Continue reading

Recap for the last two months: hxbolts

At work and for my own projects I tried to use different promise libraries, for javascript, for java (mostly on android) and of course for haxe. And I absolutely love Bolts library from corporationname (ooops, actually I can’t write it because of BSD license). Anyway, it is good strongly typed (using generics) promise library for java.

Introducing hxbolts! A pure-haxe and cross-platform port of “tasks” component from Bolts.

Imagine you have to delete all comments from blog while player playing in your game, mwahahaha 😈 . But server API has only 4 methods:

Continue reading