cloud-custodian / cloud-custodian/cel-python

Are celpy Environments thread safe?

Offen
#38 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
documentation help wanted question
Vorherrschende Sprache
Python
Sterne
174
Forks
40
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hello!

I was wondering if a celpy Environment instance could be shared amongst threads, or if we should create a new instance when we want to create a runner for a new expression.

I tried to look through the docs and source code but didn't find any reference to this.

One thing I've noticed though is that, when we call the program method, the code is doing an intermediate assignment to an instance variable of the environment, before returning, which I believe can be problematic in terms of thread preemption.
```
self.runnable = runner_class(self, expr, functions)
return self.runnable
```

Nonetheless I might have missed something and would like to get your feedback on this use case.

Thank you very much!

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.