Closed GoogleCodeExporter closed 9 years ago
The Executor is specified at construction, so you can swap your own executor at
construction.
Or provide your own Fiber implementation that does the persistence and
delegates to the actual instance for functionality.
Fiber f = new MyPersistableFiber(new ThreadFiber());
Original comment by mike.ret...@gmail.com
on 3 Nov 2010 at 2:33
[deleted comment]
Implementing an own fiber is possible, but that is more or less a
reimplementation of your existing class(es).
I copied ThreadFiber renamed RestartableThreadFiber and got this one below. The
only difference is that _thread/_scheduler are transient fields and created on
call to start(). The stop method I do not need, I just added for symmetry.
This change does not hurt the semantics so I think it might be included into
the trunk. What do you think?
I'll look what needs to be done for PoolFiber.
Original comment by istvan.d...@gmail.com
on 12 Nov 2010 at 5:23
Attachments:
Serialization logic won't be added to the base ThreadFiber and related classes
because it doesn't make sense unless the object can be rountripped (to/from
bytes) while preserving behavior. What if the thread is already started? Your
code works if the fiber is restarted every time. This creates extra maintenance
for classes and IMO serialization doesn't really make sense for Fibers. Data
objects should be serializable but not Threads/Fibers.
Original comment by mike.ret...@gmail.com
on 12 Nov 2010 at 5:39
Original issue reported on code.google.com by
istvan.d...@gmail.com
on 29 Oct 2010 at 4:51