Skip to content

Commit 8d7ef2b

Browse files
authored
fix: edit the job context and batch doc comments (#148)
1 parent 44fb8ed commit 8d7ef2b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

nitric/context.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ async def chained_middleware(ctx: C, nxt: Optional[Middleware[C]] = None) -> C:
369369

370370

371371
class JobRequest:
372-
"""Represents a translated Job, from a Job Definition, forwarded from the Nitric Runtime Server."""
372+
"""Represents a job task forwarded from the Nitric Runtime Server."""
373373

374374
data: dict[str, Any]
375375

@@ -379,28 +379,28 @@ def __init__(self, data: dict[str, Any]):
379379

380380

381381
class JobResponse:
382-
"""Represents the response to a trigger from a Job submission as a result of a SubmitJob call."""
382+
"""Represents the response to a job task, indicating the result."""
383383

384384
def __init__(self, success: bool = True):
385385
"""Construct a new EventResponse."""
386386
self.success = success
387387

388388

389389
class JobContext:
390-
"""Represents the full request/response context for an Event based trigger."""
390+
"""Represents the full request/response context for a Job task trigger."""
391391

392392
def __init__(self, request: JobRequest, response: Optional[JobResponse] = None):
393-
"""Construct a new EventContext."""
393+
"""Construct a new JobContext."""
394394
self.req = request
395395
self.res = response if response else JobResponse()
396396

397397
@staticmethod
398398
def _from_request(msg: BatchServerMessage) -> "JobContext":
399-
"""Construct a new EventContext from a Topic trigger from the Nitric Membrane."""
399+
"""Construct a new JobContext from a Job trigger from the Nitric Server."""
400400
return JobContext(request=JobRequest(data=dict_from_struct(msg.job_request.data.struct)))
401401

402402
def to_response(self) -> BatchClientMessage:
403-
"""Construct a EventContext for the Nitric Membrane from this context object."""
403+
"""Construct a JobContext for the Nitric Server from this context object."""
404404
return BatchClientMessage(job_response=BatchJobResponse(success=self.res.success))
405405

406406

nitric/resources/job.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(
5050
memory: int | None = None,
5151
gpus: int | None = None,
5252
):
53-
"""Construct a new WebsocketHandler."""
53+
"""Construct a new JobHandler."""
5454
self._handler = handler
5555
self._responses = AsyncNotifierList()
5656
self._registration_request = RegistrationRequest(
@@ -70,7 +70,7 @@ async def _message_request_iterator(self):
7070
yield response
7171

7272
async def start(self) -> None:
73-
"""Register this subscriber and listen for messages."""
73+
"""Register this job handler and listen for tasks."""
7474
channel = ChannelManager.get_channel()
7575
server = JobStub(channel=channel)
7676

0 commit comments

Comments
 (0)