What objects can/should be shared/reused?

Aperta
#166 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Documentazione
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
azure, node.js, sql, typescript

Direzione di ricerca

Inizia con le indicazioni esistenti sul ciclo di vita di client/session/operation e con la sequenza hello-world descritta nell’issue, quindi confrontale con lo scenario Azure Functions HTTP-trigger. Documenta quando ogni oggetto è terminato, cosa può essere riutilizzato e quale comportamento di cleanup e reinizializzazione è richiesto; verifica che le indicazioni rispondano alle domande su singleton.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

question

Reading through and the documentation doesn't seem to be clear on how to handle long running processes that fetch data at intervals over time.

The "hello world" paradigm that we see here:

  1. Get a client
  2. Get a session from the client
  3. Perform an operation on the session
  4. Close the operation
  5. Close the session
  6. Close the client

If we have something like an http trigger in an Azure functions instance, what can be reused:

  • Can we share a client as a singleton, or do we need a new one for each http request that comes in and executes a query?
  • Can we share a session as a singleton, or do we need a new one for each http request that comes in and executes a query?

If resources can be used as singletons, what's the recommended error handling to make sure that they get cleaned up & reinitialized if there's an error?

The only guidance is just
"After you finish working with the operation, session or client, it is better to close it, each of them has a respective method (close())."

The basic question here: at what point do we consider ourselves "finished" working with each object?

Lingua principale
TypeScript
Stelle
36
Fork
50
Merge medio
13h 46m
PR unite (30g)
9

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di databricks/databricks-sql-nodejs

Tutte le issue di databricks/databricks-sql-nodejs

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.