-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Scrapers - added link to sidebar, and laid out outline * v2.0.x -> v2.1 * Scrapers Docs - code, examples, helpers * Instagram selectors * Sites LinkedIn - botactions, conditionalbotactions, selectors - link to linkedin example - note on in dev likeAllFrom() with link for more information on current dev progress * Sidebar - add link to sites/linkedin * LinkedIn TOC improved * Instagram site toc improved * Move wait() into Navigation - polish sites/linkedin a little * screenshotAll() code updated - composed instead of custom * Add SonarCloud to Infrastructure - code smells, vulnerabilities, bugs, tech debt, code duplications * Replace LGTM badge with sonarcloud * scrollTo() botaction - code and link to example - updated function with 2nd param in new pr at botmation * navigation/helpers scrollToElement() * api/scrapers Evaluate() - code and example link * Advanced Aborting, abort(), abortPipe(), abort helpers * pipeCase & pipeCases - code and example links * isCasesSignal() type guard - included as helper * Updated sites/ LinkedIn - updated, replaced functions for recent update * sites/linkedin helpers - conditionalcallback's * api/assembly-lines Switch Pipe - code, aborting logic/table, link to example * Switch Pipe copy improvement * Update Assembly-Lines - code with explanations for aborting behavior of each * errors & inject aborting behavior - updated errors code too * Utilties BotAction's updated code - abortlinesignal behavior explanations - moved sleep() function into navigation helpers * forAll() extended cb/pipe params * Extended Advanced Conditionals with pipeCase(s) - added notes to Switch Pipe with links, and reminder that they are separate BotAction's that don't depend on each other, but they tap into unique behavior when composed together - ConditionalCallback interface with basic explanation * Advanced/Conditionals expanded - cases signal, switch pipe aborting behavior * Advanced/aborting - toc - trying to get the important content on there - future iterations to polish/improve readability * home page copy & advanced/aborting * roadmap update * advanced aborting doc wip * advanced aborting * sidebar navigation change - sites may hold more value to majority visitors who are probably new * helpers at bottom - consistent across docs site * review/polish
- Loading branch information
Showing
27 changed files
with
1,192 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
title: Aborting | ||
--- | ||
|
||
## AbortLine Signal | ||
|
||
Sometimes it's necessary to abort an assembly line(s) of BotAction's. Perhaps something is removed from a web page or a condition wasn't met that subsequent BotAction's rely on. When this happens, a BotAction returns an `AbortLineSignal`. | ||
|
||
```typescript | ||
type AbortLineSignal = { | ||
brand: 'Abort_Signal', | ||
assembledLines: number, | ||
pipeValue?: PipeValue | ||
} | ||
``` | ||
AbortLine signals are safely created with the [createAbortLineSignal()](/api/abort#createabortlinesignal) helper. It's a simple JSON object with potentially two to three properties. | ||
### Assembled Lines Count | ||
An AbortLine signal's important property is called `assembledLines`. It informs the assembler how many lines of assembly to break. One is one line, two is two, three is three and so forth. | ||
The default count of `assembledLines` is one for both the [abort()](/api/abort#abort) BotAction and the [createAbortLineSignal()](/api/abort#createabortlinesignal) helper. It can be any positive number, including zero. | ||
## Infinity AbortLine Signal | ||
It's possible to abort all lines of assembly without knowing how many there are by returning an Infinity AbortLine signal. | ||
Infinity AbortLine signals have `assembledLines` set to `0`. When an assembler processes an Infinity AbortLine signal, it aborts what it's doing and returns the same signal without change. | ||
### Optional Pipe Value | ||
`AbortLineSignal` has an optional param called `pipeValue` that carries a `PipeValue` back to the final aborted assembler for return. | ||
> The optional `pipeValue` param does not get returned by a [Chain](/api/assembly-lines#chain), when it's the final assembler to process an AbortLine signal. | ||
## Process AbortLine Signal | ||
Almost every assembler processes an AbortLine signal with the [processAbortLineSignal()](/api/abort#processabortlinesignal) helper. It supports all main use-cases of `assembledLines`: 0, 1, and 2+. | ||
Here is a table for the default assemblers' aborting behavior: | ||
| assembledLines | effect | | ||
| - | - | | ||
| 0 | Infinity AbortLine Signal aborts every BotAction and returns itself without change on each abort | | ||
| 1 | Default AbortLine Signal aborts only one line of assembled BotActions and returns the abortLineSignal.pipeValue | | ||
| 2+ | Level specific AbortLine Signal aborts one line of assembled BotActions at a time while reducing its assembledLines count to 1 for final abort | | ||
Each assembler will detect the value returned by the resolved BotAction for an AbortLine signal. If it is one, it processes it to the effect listed above. | ||
This is the default aborting behavior. There are exceptions for some BotAction's such as the Utilities, Switch Pipe, and Pipe Case(s), which implement their own unique aborting behavior. | ||
## Unique Aborting behavior | ||
[Switch Pipe](/api/assembly-lines#switch-pipe) implements its own AbortLine signal behavior in order to support its own unique functionality. When it hasn't received a [CasesSignal](/advanced/conditionals/#cases-signal) with its condition passed, it ignores default AbortLine signals. That's because [abort()](/api/abort#abort) is treated like `break;` from the traditional `switch(){}` code block, inside a [Switch Pipe](/api/assembly-lines#switch-pipe). | ||
Some BotAction's, like Utilities, have unique AbortLine signal behavior for aborting parts of the unique assemblers. For example, a [For All](/api/utilities#for-all) BotAction's loop iteration (runs an assembled line of BotActions) can abort out of its loop iteration with a default AbortLine signal or abort the entire loop with two or more `assembledLines`. | ||
BotAction's with unique aborting behavior have their aborting functionality explained in their documentation, listed under API in the sidebar. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.