Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  session-async-task-status.ts

  Sprache: JAVA
 

import { normalizeOptionalString } from "../shared/string-coerce.js";
import { listTasksForOwnerKey } from "../tasks/runtime-internal.js";
import type { TaskRecord, TaskRuntime, TaskStatus } from "../tasks/task-registry.types.js";

const DEFAULT_ACTIVE_STATUSES = new Set<TaskStatus>(["queued""running"]);

export function findActiveSessionTask(params: {
  sessionKey?: string;
  runtime?: TaskRuntime;
  taskKind?: string;
  statuses?: ReadonlySet<TaskStatus>;
  sourceIdPrefix?: string;
}): TaskRecord | undefined {
  const normalizedSessionKey = normalizeOptionalString(params.sessionKey);
  if (!normalizedSessionKey) {
    return undefined;
  }
  const statuses = params.statuses ?? DEFAULT_ACTIVE_STATUSES;
  const taskKind = normalizeOptionalString(params.taskKind);
  const sourceIdPrefix = normalizeOptionalString(params.sourceIdPrefix);
  const matches = listTasksForOwnerKey(normalizedSessionKey).filter((task) => {
    if (task.scopeKind !== "session") {
      return false;
    }
    if (params.runtime && task.runtime !== params.runtime) {
      return false;
    }
    if (!statuses.has(task.status)) {
      return false;
    }
    if (taskKind && task.taskKind !== taskKind) {
      return false;
    }
    if (sourceIdPrefix) {
      const sourceId = normalizeOptionalString(task.sourceId) ?? "";
      if (sourceId !== sourceIdPrefix && !sourceId.startsWith(`${sourceIdPrefix}:`)) {
        return false;
      }
    }
    return true;
  });
  if (matches.length === 0) {
    return undefined;
  }
  return matches.find((task) => task.status === "running") ?? matches[0];
}

export function buildSessionAsyncTaskStatusDetails(task: TaskRecord): Record<string, unknown> {
  return {
    async: true,
    active: true,
    existingTask: true,
    status: task.status,
    task: {
      taskId: task.taskId,
      ...(task.runId ? { runId: task.runId } : {}),
    },
    ...(task.taskKind ? { taskKind: task.taskKind } : {}),
    ...(task.progressSummary ? { progressSummary: task.progressSummary } : {}),
    ...(task.sourceId ? { sourceId: task.sourceId } : {}),
  };
}

Messung V0.5 in Prozent
C=100 H=97 G=98

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik