anchor.diff:          return !s
       }
   
  -    member __.StopAll() = async {
  +    member __.SignalStop(name: string) = context.RunAsync(async {
  +        match runningPlugins |> Seq.tryFind(fun (p,_) -> p.Info.Name = name) with
  +        | Some x -> TryStopPlugin(x)
  +        | None -> failwithf "No plugin %s running" name
  +    })
  +
  +    member __.Stop(name: string, cancel: CancellationToken) = 
  +        context.RunAsync(async {
  +            match runningPlugins |> Seq.tryFind(fun (p,_) -> p.Info.Name = name) with
  +            | Some x -> TryStopPlugin(x)
  +            | None -> failwithf "No plugin %s running" name
  +
  +            while (runningPlugins 
  +                   |> Seq.tryFind(fun (p,_) -> p.Info.Name = name)).IsSome do
  +                do! Async.Sleep(50)
  +                cancel.ThrowIfCancellationRequested()
  +        })
  +
  +    member __.SignalStopAll() = async {
           do! Async.SwitchToActor(context)
           log.Trace "2. Stop all on %s" (Executor.GetCurrentName())
   
  
positive.code: ﻿namespace Ultima
  
  open System
  open System.Threading.Tasks
  open System.Reflection
  open System.Collections.Generic
  
negative.code:         | Some t -> Some(Activator.CreateInstance(t) :?> IPlugin)
          | None -> log.Info "%s is not an Ultima plugin" pluginPath
                    None
  
      let HookTaskEnd (plugin: IPlugin, task: Task) = 
          task.ContinueWith( (fun (t: Task) -> 
  