Skip to content

Create JsRuntime#152

Merged
syntheticmagus merged 31 commits intoBabylonJS:masterfrom
syntheticmagus:createJsRuntime
Feb 13, 2020
Merged

Create JsRuntime#152
syntheticmagus merged 31 commits intoBabylonJS:masterfrom
syntheticmagus:createJsRuntime

Conversation

@syntheticmagus
Copy link
Copy Markdown
Contributor

Beginning the real decoupling process by removing all direct dependencies on RuntimeImpl and replacing them with dependencies on the new JsRuntime. This has resulted in some temporary code duplication as the Babylon Native API hasn't been changed yet, only its internal structure, so some things like URL loading end up semi-duplicated as ownership of capabilities is being moved from one place to another.

@syntheticmagus syntheticmagus marked this pull request as ready for review February 12, 2020 22:07
Copy link
Copy Markdown
Contributor

@bghgary bghgary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly good. Some small issues.

Comment thread Library/Source/NetworkUtils.h Outdated
Comment on lines +12 to +13
arcana::task<std::string, std::exception_ptr> LoadUrlToStringAsync(const std::string url);
arcana::task<std::vector<uint8_t>, std::exception_ptr> LoadUrlToBytesAsync(const std::string url);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: how about LoadTextAsync and LoadBinaryAsync for the function names?

Comment thread Library/Source/RuntimeImpl.cpp Outdated
auto lock = AcquireTaskLock();
auto whenAllTask = arcana::when_all(LoadUrlAsync<std::string>(GetAbsoluteUrl(url).data()), Task);
Task = whenAllTask.then(*m_dispatcher, m_cancelSource, [this, url](const std::tuple<std::string, arcana::void_placeholder>& args) {
std::scoped_lock lock{ m_taskMutex };
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: spacing everywhere

Suggested change
std::scoped_lock lock{ m_taskMutex };
std::scoped_lock lock{m_taskMutex};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did it, though I'm generally not a huge fan of more terse styles. Is there an established convention we're trying to align with on that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLVM default for clang format

Comment thread Library/Source/XMLHttpRequest.cpp
Comment thread Library/Source/XMLHttpRequest.cpp Outdated
@syntheticmagus syntheticmagus merged commit fc795f9 into BabylonJS:master Feb 13, 2020
@syntheticmagus syntheticmagus deleted the createJsRuntime branch February 13, 2020 20:52
bghgary added a commit to bghgary/BabylonNative that referenced this pull request Apr 13, 2026
Includes:
- BabylonJS#147: Fix WorkQueue destructor deadlock
- BabylonJS#149: Merge WorkQueue into AppRuntime
- BabylonJS#150: Fix WebSocket test flake + UrlLib/AndroidExtensions updates
- BabylonJS#151: Clean up deadlock regression test
- BabylonJS#152: Fix performance test flake

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bghgary added a commit that referenced this pull request Apr 14, 2026
[Created by Copilot on behalf of @bghgary]

Bump JsRuntimeHost, arcana.cpp, and AndroidExtensions to latest.

## JsRuntimeHost (8086014)
- **#147**: Fix WorkQueue destructor deadlock (cancel + no-op wake)
- **#149**: Merge WorkQueue into AppRuntime (eliminates split-lifetime
issues)
- **#150**: Fix WebSocket test flake + update UrlLib/AndroidExtensions
for consistent onClose-after-onError
- **#151**: Clean up deadlock regression test (one-shot hook, expanded
comments)
- **#152**: Fix performance test flake (remove upper-bound setTimeout
assertion)
- **#154**: Hide arcana behind pimpl pattern in AppRuntime (arcana
headers no longer exposed publicly)
- **#155**: Update package-lock.json

## arcana.cpp (b9bf9d8)
Includes test hooks for the deadlock regression test
(`ARCANA_TEST_HOOKS` / `arcana::test_hooks::blocking_concurrent_queue`).

## AndroidExtensions (2e85a8d)
Removes the redundant `errorCallback` from `onClose` in the Java
WebSocket wrapper (AndroidExtensions#16). Matches the version
JsRuntimeHost depends on via UrlLib.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants