Can you expand on this statement:

“if it is used as a future via the result option, it is obligated to return the 
result.”

I didn’t see anything about this in the ML 8 docs for xdmp:spawn() and it seems 
pretty important. 

One general comment I’ll make about the ML docs is that it seems to 
assume/require a fairly encyclopedic knowledge of many subtle details. I’ve now 
read pretty much all the guides at least once and spent a lot of time in the 
reference docs, and while it’s all easy to access and very useful, it’s still a 
challenge to fully understand the implications of many things. For example, the 
documentation for various options for ranges only shows the syntax but has no 
guidance about semantics or what values are actually allowed, which would be 
very useful. This is documentation where a few well-placed see-alsos or a bit 
more usage guidance would go a long way. As a professional technical writer I 
know how challenging this aspect of docs is but it would help a lot.

Cheers,

Eliot

On 8/14/17, 8:32 AM, "[email protected] on behalf of Erik 
Hennum" <[email protected] on behalf of 
[email protected]> wrote:

    Hi, Eliot:
    
    xdmp:spawn() doesn't return an identifier because, if it is used as a 
future via the result option, it is obligated to return the result.
    
    The approach you sketch below -- passing in an identifier and writing 
tickets to a status database -- is pretty much what InfoStudio did.  
    
    One refinement would be to log status in a server field via 
xdmp:set-server-field() and, on completion, write final status to a database 
(for durability in the case of a restart).
    
    
    Hoping that helps,
    
    
    Erik Hennum
    
    ________________________________________
    From: [email protected] 
[[email protected]] on behalf of Eliot Kimber 
[[email protected]]
    Sent: Saturday, August 12, 2017 10:15 AM
    To: MarkLogic Developer Discussion
    Subject: [MarkLogic Dev General] Tracking Spawned Tasks?
    
    Using ML 8
    
    I’m refining a profiling application that spawns a number of tasks and 
then, eventually, reports on the results once all the tasks have completed.
    
    Right now I just fire off the tasks and then refresh my app, which looks 
for results.
    
    It would be nice to be able to show the status of the spawned tasks but it 
looks like xdmp:spawn() doesn’t return anything (sort of expected to get some 
sort of task ID or something) and so there’s no obvious way to track spawned 
tasks from the spawning application.
    
    I could do something like generate private task IDs and pass those as 
parameters to the spawned tasks and then maintain a set of task status docs, 
but I was hoping there was some something easier.
    
    It seems like it would be a common requirement but I couldn’t find anything 
useful in the ML 8 docs or searching the web.
    
    Thanks,
    
    Eliot
    --
    Eliot Kimber
    http://contrext.com
    
    
    
    
    _______________________________________________
    General mailing list
    [email protected]
    Manage your subscription at:
    http://developer.marklogic.com/mailman/listinfo/general
    _______________________________________________
    General mailing list
    [email protected]
    Manage your subscription at: 
    http://developer.marklogic.com/mailman/listinfo/general
    





_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to