PageSourceSearch

https://skiplabs.io/assets/js/f13c5093.756618a1.js

js skiplabs.io collected 2026-10-02 14:45:17 UTC 9,127 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkwww=globalThis.webpackChunkwww||[]).push([[4317],{5438(e,r,s){s.r(r),s.d(r,{assets:()=>t,contentTitle:()=>c,default:()=>h,frontMatter:()=>d,metadata:()=>n,toc:()=>a});const n=JSON.parse('{"id":"api/helpers/classes/PolledExternalService","title":"PolledExternalService","description":"An external HTTP service that is kept up-to-date by polling.","source":"@site/docs/api/helpers/classes/PolledExternalService.md","sourceDirName":"api/helpers/classes","slug":"/api/helpers/classes/PolledExternalService","permalink":"/docs/api/helpers/classes/PolledExternalService","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{},"sidebar":"docsSidebar","previous":{"title":"Min","permalink":"/docs/api/helpers/classes/Min"},"next":{"title":"SkipExternalService","permalink":"/docs/api/helpers/classes/SkipExternalService"}}');var l=s(4848),i=s(8453);const d={},c="PolledExternalService",t={},a=[{value:"Implements",id:"implements",level:2},{value:"Constructors",id:"constructors",level:2},{value:"new PolledExternalService()",id:"new-polledexternalservice",level:3},{value:"Parameters",id:"parameters",level:4},{value:"Returns",id:"returns",level:4},{value:"Methods",id:"methods",level:2},{value:"shutdown()",id:"shutdown",level:3},{value:"Returns",id:"returns-1",level:4},{value:"Implementation of",id:"implementation-of",level:4},{value:"subscribe()",id:"subscribe",level:3},{value:"Parameters",id:"parameters-1",level:4},{value:"Returns",id:"returns-2",level:4},{value:"Implementation of",id:"implementation-of-1",level:4},{value:"unsubscribe()",id:"unsubscribe",level:3},{value:"Parameters",id:"parameters-2",level:4},{value:"Returns",id:"returns-3",level:4},{value:"Implementation of",id:"implementation-of-2",level:4}];function o(e){const r={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",hr:"hr",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.header,{children:(0,l.jsx)(r.h1,{id:"polledexternalservice",children:"PolledExternalService"})}),"\n",(0,l.jsx)(r.p,{children:"An external HTTP service that is kept up-to-date by polling."}),"\n",(0,l.jsxs)(r.p,{children:["A ",(0,l.jsx)(r.code,{children:"PolledExternalService"})," may be composed of one or more ",(0,l.jsx)(r.a,{href:"https://skiplabs.io/docs/api/helpers/interfaces/PolledHTTPResource",children:(0,l.jsx)(r.code,{children:"PolledHTTPResource"})}),"s, each of which describes a single endpoint and how to poll it."]}),"\n",(0,l.jsx)(r.h2,{id:"implements",children:"Implements"}),"\n",(0,l.jsxs)(r.ul,{children:["\n",(0,l.jsx)(r.li,{children:(0,l.jsx)(r.code,{children:"ExternalService"})}),"\n"]}),"\n",(0,l.jsx)(r.h2,{id:"constructors",children:"Constructors"}),"\n",(0,l.jsx)(r.h3,{id:"new-polledexternalservice",children:"new PolledExternalService()"}),"\n",(0,l.jsx)(r.pre,{children:(0,l.jsx)(r.code,{className:"language-ts",children:"new PolledExternalService(resources): PolledExternalService\n"})}),"\n",(0,l.jsx)(r.p,{children:"Construct a polled external service."}),"\n",(0,l.jsx)(r.h4,{id:"parameters",children:"Parameters"}),"\n",(0,l.jsxs)(r.table,{children:[(0,l.jsx)(r.thead,{children:(0,l.jsxs)(r.tr,{children:[(0,l.jsx)(r.th,{children:"Parameter"}),(0,l.jsx)(r.th,{children:"Type"}),(0,l.jsx)(r.th,{children:"Description"})]})}),(0,l.jsx)(r.tbody,{children:(0,l.jsxs)(r.tr,{children:[(0,l.jsx)(r.td,{children:(0,l.jsx)(r.code,{children:"resources"})}),(0,l.jsx)(r.td,{children:"{}"}),(0,l.jsx)(r.td,{children:"Specification(s) of external resource(s) to poll"})]})})]}),"\n",(0,l.jsx)(r.h4,{id:"returns",children:"Returns"}),"\n",(0,l.jsx)(r.p,{children:(0,l.jsx)(r.a,{href:"/docs/api/helpers/classes/PolledExternalService",children:(0,l.jsx)(r.code,{children:"PolledExternalService"})})}),"\n",(0,l.jsx)(r.h2,{id:"methods",children:"Methods"}),"\n",(0,l.jsx)(r.h3,{id:"shutdown",children:"shutdown()"}),"\n",(0,l.jsx)(r.pre,{children:(0,l.jsx)(r.code,{className:"language-ts",children:"shutdown(): Promise<void>\n"})}),"\n",(0,l.jsx)(r.p,{children:"Shutdown the external service."}),"\n",(0,l.jsx)(r.h4,{id:"returns-1",children:"Returns"}),"\n",(0,l.jsxs)(r.p,{children:[(0,l.jsx)(r.code,{children:"Promise"}),"<",(0,l.jsx)(r.code,{children:"void"}),">"]}),"\n",(0,l.jsx)(r.h4,{id:"implementation-of",children:"Implementation of"}),"\n",(0,l.jsx)(r.pre,{children:(0,l.jsx)(r.code,{className:"language-ts",children:"Exter
1nalService.shutdown\n"})}),"\n",(0,l.jsx)(r.hr,{}),"\n",(0,l.jsx)(r.h3,{id:"subscribe",children:"subscribe()"}),"\n",(0,l.jsx)(r.pre,{children:(0,l.jsx)(r.code,{className:"language-ts",children:"subscribe(\n   instance, \n   resourceName, \n   params, \n   callbacks): Promise<void>\n"})}),"\n",(0,l.jsx)(r.p,{children:"Subscribe to a resource provided by the external service."}),"\n",(0,l.jsx)(r.h4,{id:"parameters-1",children:"Parameters"}),"\n",(0,l.jsxs)(r.table,{children:[(0,l.jsx)(r.thead,{children:(0,l.jsxs)(r.tr,{children:[(0,l.jsx)(r.th,{children:"Parameter"}),(0,l.jsx)(r.th,{children:"Type"}),(0,l.jsx)(r.th,{children:"Description"})]})}),(0,l.jsxs)(r.tbody,{children:[(0,l.jsxs)(r.tr,{children:[(0,l.jsx)(r.td,{children:(0,l.jsx)(r.code,{children:"instance"})}),(0,l.jsx)(r.td,{children:(0,l.jsx)(r.code,{children:"string"})}),(0,l.jsx)(r.td,{children:"Instance identifier of the external resource."})]}),(0,l.jsxs)(r.tr,{children:[(0,l.jsx)(r.td,{children:(0,l.jsx)(r.code,{children:"resourceName"})}),(0,l.jsx)(r.td,{children:(0,l.jsx)(r.code,{children:"string"})}),(0,l.jsx)(r.td,{children:"-"})]}),(0,l.jsxs)(r.tr,{children:[(0,l.jsx)(r.td,{children:(0,l.jsx)(r.code,{children:"params"})}),(0,l.jsx)(r.td,{children:(0,l.jsx)(r.code,{children:"Json"})}),(0,l.jsx)(r.td,{children:"Parameters of the external resource."})]}),(0,l.jsxs)(r.tr,{children:[(0,l.jsx)(r.td,{children:(0,l.jsx)(r.code,{children:"callbacks"})}),(0,l.jsxs)(r.td,{children:["{ ",(0,l.jsx)(r.code,{children:"error"}),": (",(0,l.jsx)(r.code,{children:"error"}),") => ",(0,l.jsx)(r.code,{children:"void"}),"; ",(0,l.jsx)(r.code,{children:"update"}),": (",(0,l.jsx)(r.code,{children:"updates"}),", ",(0,l.jsx)(r.code,{children:"isInit"}),") => ",(0,l.jsx)(r.code,{children:"Promise"}),"<",(0,l.jsx)(r.code,{children:"void"}),">; }"]}),(0,l.jsx)(r.td,{children:"Callbacks to react on error/update."})]}),(0,l.jsxs)(r.tr,{children:[(0,l.jsx)(r.td,{children:(0,l.jsx)(r.code,{children:"callbacks.error"})}),(0,l.jsxs)(r.td,{children:["(",(0,l.jsx)(r.code,{children:"error"}),") => ",(0,l.jsx)(r.code,{children:"void"})]}),(0,l.jsx)(r.td,{children:"Error callback to log the error that prevent an idermetiate update."})]}),(0,l.jsxs)(r.tr,{children:[(0,l.jsx)(r.td,{children:(0,l.jsx)(r.code,{children:"callbacks.update"})}),(0,l.jsxs)(r.td,{children:["(",(0,l.jsx)(r.code,{children:"updates"}),", ",(0,l.jsx)(r.code,{children:"isInit"}),") => ",(0,l.jsx)(r.code,{children:"Promise"}),"<",(0,l.jsx)(r.code,{children:"void"}),">"]}),(0,l.jsx)(r.td,{children:"Update callback."})]})]})]}),"\n",(0,l.jsx)(r.h4,{id:"returns-2",children:"Returns"}),"\n",(0,l.jsxs)(r.p,{children:[(0,l.jsx)(r.code,{children:"Promise"}),"<",(0,l.jsx)(r.code,{children:"void"}),">"]}),"\n",(0,l.jsx)(r.h4,{id:"implementation-of-1",children:"Implementation of"}),"\n",(0,l.jsx)(r.pre,{children:(0,l.jsx)(r.code,{className:"language-ts",children:"ExternalService.subscribe\n"})}),"\n",(0,l.jsx)(r.hr,{}),"\n",(0,l.jsx)(r.h3,{id:"unsubscribe",children:"unsubscribe()"}),"\n",(0,l.jsx)(r.pre,{children:(0,l.jsx)(r.code,{className:"language-ts",children:"unsubscribe(instance): void\n"})}),"\n",(0,l.jsx)(r.p,{children:"Unsubscribe from a resource provided by the external service."}),"\n",(0,l.jsx)(r.h4,{id:"parameters-2",children:"Parameters"}),"\n",(0,l.jsxs)(r.table,{children:[(0,l.jsx)(r.thead,{children:(0,l.jsxs)(r.tr,{children:[(0,l.jsx)(r.th,{children:"Parameter"}),(0,l.jsx)(r.th,{children:"Type"}),(0,l.jsx)(r.th,{children:"Description"})]})}),(0,l.jsx)(r.tbody,{children:(0,l.jsxs)(r.tr,{children:[(0,l.jsx)(r.td,{children:(0,l.jsx)(r.code,{children:"instance"})}),(0,l.jsx)(r.td,{children:(0,l.jsx)(r.code,{children:"string"})}),(0,l.jsx)(r.td,{children:"Instance identifier of the external resource."})]})})]}),"\n",(0,l.jsx)(r.h4,{id:"returns-3",children:"Returns"}),"\n",(0,l.jsx)(r.p,{children:(0,l.jsx)(r.code,{children:"void"})}),"\n",(0,l.jsx)(r.h4,{id:"implementation-of-2",children:"Implementation of"}),"\n",(0,l.jsx)(r.pre,{children:(0,l.jsx)(r.code,{className:"language-ts",children:"ExternalService.unsubscribe\n"})})]})}function h(e={}){const{wrapper:r}={...(0,i.R)(),...e.components};return r?(0,l.jsx)(r,{...e,children:(0,l.jsx)(o,{...e})}):o(e)}},8453(e,r,s){s.d(r,{R:()=>d,x:()=>c});var n=s(6540);const l={},i=n.createContext(l);function d(e){const r=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(r):{...r,...e}}),[r,e])}function c(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:d(e.components),n.createElement(i.Provider,{value:r},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.