mastodontech.de ist einer von vielen unabhängigen Mastodon-Servern, mit dem du dich im Fediverse beteiligen kannst.
Offen für alle (über 16) und bereitgestellt von Markus'Blog

Serverstatistik:

1,4 Tsd.
aktive Profile

#rustyscript

0 Beiträge0 Beteiligte0 Beiträge heute
Ambraven :verifinking:​<p>I'm yet again defeated by iced-rs and threads management... </p><p>What I want to do is let the application run a js script (for reasons) that can send tcp request to a device (again, for reasons). And I have this working. It's a bit of a mess but it works.</p><p>Only now I want to be able to stop the script (without alt-F4 the whole application) because the script can take some time to execute and it's annoying when there is an error in the script.</p><p>Only rustyscript doesn't have a mechanism for that, so right now I'm resorting to make a subscriber for the js execution. Which is a pain, but I think I more or less got it...</p><p>Except...</p><p><a href="https://social.mochi.academy/tags/rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rust</span></a> <a href="https://social.mochi.academy/tags/iced_rs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>iced_rs</span></a> <a href="https://social.mochi.academy/tags/rustyscript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rustyscript</span></a> <a href="https://social.mochi.academy/tags/rustlang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rustlang</span></a></p>
Ambraven :verifinking:​<p><a href="https://social.mochi.academy/tags/rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rust</span></a> <a href="https://social.mochi.academy/tags/rustlang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rustlang</span></a> </p><p>I'm trying to make <a href="https://social.mochi.academy/tags/rustyscript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rustyscript</span></a> work with <a href="https://social.mochi.academy/tags/iced" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>iced</span></a>-rs but it doesn't seems to want to play nice.</p><p>Specifically I want to need able to run a js script with rustyscript and keep the option to stop the script when I want. But Rustyscript Runtime doesn't play well with iced-rs' own concurrency mechanisms. </p><p>The other difficulty is I need to register rust function in the js runtime, and I don't find a way to do that using Workers.</p><p>I'm basically running circle around the problem... I got something to compile but the js execution thread crashes with this message :</p><p><code>Cannot start a runtime from within a runtime. This happens because a function (like</code>block_on<code>) attempted to block the current thread while the thread is being used to drive asynchronous tasks.</code></p>