<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<div dir="auto">I understand that Continuation API is not intended to be used directly, and may change at any time. And you are right the snapshot I mean serializing and resuming the stack frames, things like that. <br></div><div dir="auto"><br></div><div dir="auto">Thanks for the advice, and the information. I appreciate it.<br></div><div dir="auto"><br></div><div dir="auto">Mar 19, 2025, 01:21 by alan.bateman@oracle.com:<br></div><blockquote class="tutanota_quote" style="border-left: 1px solid #93A3B8; padding-left: 10px; margin-left: 5px;"><div dir="auto">On 18/03/2025 16:39, <a target="_blank" rel="noopener noreferrer" class="" href="mailto:common1945@tutanota.com">common1945@tutanota.com</a> wrote:<br></div><blockquote type="cite"><div dir="auto">I am doing some experiments that will make use of
loom's Continuation with jdk22+. I know that I can achieve java
Continuation effect with following code. However, I have a few
questions:<br></div><div dir="auto"><br></div><ol><li dir="auto">Is it possible to pass in arguments like Lua's
coroutine[1][2]?<br></li><li dir="auto">Is it possible to yield/ return some values like
Lua's coroutine[1][2]?<br></li><li dir="auto">Does the way to communicate between the
Continuation block i.e. Runnable and outside Runnable merely
be able to achieved by embedding e.g. BlockingQueue inside the
Runnable code block?<br></li><li dir="auto">Is it possible to capture Continuation's snapshot
for later use?<br></li></ol></blockquote><div dir="auto"><br></div><div dir="auto">I don't want to spoil your experiments but just to say that the
internal Continuation API that you found is not intended to be used
directly, isn't documented, and may change at any time. For Lua like
passing of parameters from resume to yield then you can extend
Continuation to add a field for the passed parameter.<br></div><div dir="auto"> <br></div><div dir="auto"> By snapshot I assume you mean being able to serialize and resume in
a different VM. There isn't any support for that.<br></div><div dir="auto"> <br></div><div dir="auto"> -Alan<br></div></blockquote><div dir="auto"><br></div> </body>
</html>