# `nupp.workers` ## Types ### `Scope` _interface_ ```nupp interface Scope is workers.ScopeToken readonly spawn: function( borrows self: Scope, F, ...: unpackof workers.Submitted(F) ): workers.Task readonly close: function(borrows self: Scope): nil readonly drop: function(takes self: Scope): nil end ``` #### Methods ##### `spawn` ```nupp spawn: function( borrows self: workers.PublicScope, F, ...: unpackof workers.Submitted(F) ): workers.Task ``` ###### Arguments | Name | Type | Description | | --- | --- | --- | | `borrows self` | `workers.PublicScope` | | | `?` | `F` | | | `...` | `unpackof workers.Submitted(F)` | | ###### Returns | Type | Description | | --- | --- | | `workers.Task\` | | ##### `close` ```nupp close: function(borrows self: workers.PublicScope): nil ``` ###### Arguments | Name | Type | Description | | --- | --- | --- | | `borrows self` | `workers.PublicScope` | | ###### Returns | Type | Description | | --- | --- | | `nil` | | ##### `drop` ```nupp drop: function(takes self: workers.PublicScope): nil ``` ###### Arguments | Name | Type | Description | | --- | --- | --- | | `takes self` | `workers.PublicScope` | | ###### Returns | Type | Description | | --- | --- | | `nil` | | ### `ScopeToken` _interface_ ```nupp affine interface ScopeToken terminal readonly drop: function(takes self: ScopeToken): nil end ``` The cleanup contract a structured worker scope carries. #### Methods ##### `drop` ```nupp drop: function(takes self: workers.ScopeToken): nil ``` ###### Arguments | Name | Type | Description | | --- | --- | --- | | `takes self` | `workers.ScopeToken` | | ###### Returns | Type | Description | | --- | --- | | `nil` | | ### `Submittable` _type_ ```nupp type Submittable = sendable function(...: any): any ``` What may actually be submitted: a module member, or an outlined literal whose effectively-final captures can be copied to another lane. Exported so a task scope can hold its `fork` to the same bound without linking this module. ### `Task` _type_ ```nupp type Task = TaskType(F) ``` The typed handle for one submitted function. #### Type parameters | Name | Description | | --- | --- | | `F` | |