emulate JS events loop
implement binary_loading