jina.peapods.peas

class jina.peapods.peas.BasePea(args)[source]

Bases: object

BasePea is a thread/process- container of BaseRuntime. It leverages threading.Thread or multiprocessing.Process to manage the lifecycle of a BaseRuntime object in a robust way.

A BasePea must be equipped with a proper Runtime class to work.

runtime_cls = None
daemon = None

required here to set process/thread daemon

run()[source]

Method representing the BaseRuntime activity.

This method overrides run() in threading.Thread or multiprocesssing.Process.

Note

run() is running in subprocess/thread, the exception can not be propagated to the main process. Hence, please do not raise any exception here.

start()[source]

Start the Pea.

This method overrides start() in threading.Thread or multiprocesssing.Process.

close()[source]
Return type

None

property role

Get the role of this pea in a pod

Return type

PeaRoleType