CINXE.COM
mesos/3rdparty/libprocess/README.md at master · apache/mesos · GitHub
<!DOCTYPE html> <html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system" data-a11y-link-underlines="true" > <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-74231a1f3bbb.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-8a995f0bacd4.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-f37fb7684b1f.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-9ac301c3ebe5.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-cd826e8636dc.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-f91b0f603451.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-83beb16e0ecf.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-6e122dab64fc.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-18119e682df0.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-primitives-225433424a87.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-aaa714e5674d.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-7eaba1d4847c.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-ea73c9cb5377.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/repository-4fce88777fa8.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-0210be90f4d3.css" /> <script type="application/json" id="client-env">{"locale":"en","featureFlags":["a11y_quote_reply_fix","copilot_immersive_issue_preview","copilot_new_references_ui","copilot_chat_repo_custom_instructions_preview","copilot_no_floating_button","copilot_topics_as_references","copilot_read_shared_conversation","copilot_duplicate_thread","copilot_buffered_streaming","dotcom_chat_client_side_skills","experimentation_azure_variant_endpoint","failbot_handle_non_errors","fgpat_form_ui_updates","geojson_azure_maps","ghost_pilot_confidence_truncation_25","ghost_pilot_confidence_truncation_40","github_models_o3_mini_streaming","insert_before_patch","issues_react_remove_placeholders","issues_react_blur_item_picker_on_close","marketing_pages_search_explore_provider","primer_react_css_modules_ga","react_data_router_pull_requests","remove_child_patch","sample_network_conn_type","swp_enterprise_contact_form","site_proxima_australia_update","viewscreen_sandbox","issues_react_create_milestone","issues_react_cache_fix_workaround","lifecycle_label_name_updates","copilot_task_oriented_assistive_prompts","issue_types_prevent_private_type_creation","refresh_image_video_src","react_router_dispose_on_disconnect","codespaces_prebuild_region_target_update","turbo_app_id_restore","copilot_code_review_sign_up_closed"]}</script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-78acda12a57e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover_js-9da652f58479.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_arianotify-polyfill_ariaNotify-polyfill_js-node_modules_github_mi-3abb8f-46b9f4874d95.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_failbot_failbot_ts-75968cfb5298.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-f04cb2a9fc8c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_index_mjs-0dbb79f97f8f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-f690fd9ae3d5.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-62d275b7ddd9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_text-expander-element_dist_index_js-78748950cb0c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-8e9f78-a90ac05d2469.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-b5f1d7-a1760ffda83d.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_markdown-toolbar-element_dist_index_js-ceef33f593fa.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_primer_view-co-c44a69-efa32db3a345.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-394f8eb34f19.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-8206a1f1fc89.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_braintree_browser-detection_dist_browser-detection_js-node_modules_githu-2906d7-2a07a295af40.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-be8cb88f481b.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_morphdom_dist_morphdom-e-7c534c-a4a1922eb55f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_turbo_dist_turbo_es2017-esm_js-a03ee12d659a.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-893f9f-b6294cf703b7.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-e3180fe3bcb3.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_quote-selection_dist_index_js-node_modules_github_session-resume_-947061-e7a6c4a19f98.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_updatable-content_updatable-content_ts-2a55124d5c52.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_task-list_ts-app_assets_modules_github_sso_ts-ui_packages-900dde-768abe60b1f8.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-3e000c5d31a9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_ajax-error_ts-app_assets_modules_github_behaviors_include-87a4ae-b8865f653f6b.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-e429cff6ceb1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-c1f5beceda17.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-f6223d90c7ba.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-01e85cd1be94.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_catalyst_lib_inde-dbbea9-26cce2010167.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-1c0aedc134b1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/primer-react-dee7fde768ad.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-core-a18127980111.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-lib-f1bca44e0926.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/octicons-react-cf2f2ab8dab4.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_emotion_is-prop-valid_dist_emotion-is-prop-valid_esm_js-node_modules_emo-62da9f-2df2f32ec596.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_stacktrace-parser_dist_s-e7dcdd-9a233856b02c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover-fn_js-55fea94174bf.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_dompurify_dist_purify_es_mjs-dd1d3ea6a436.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lodash-es__Stack_js-node_modules_lodash-es__Uint8Array_js-node_modules_l-4faaa6-4a736fde5c2f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lodash-es__baseIsEqual_js-8929eb9718d5.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_react-intersection-observer_react-intersection-observer_modern_mjs-node_-b27033-ba82cef135e3.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_focus-visible_dist_focus-visible_js-node_modules_fzy_js_index_js-node_mo-f2fece-29a0ceccb1f1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_aria-live_aria-live_ts-ui_packages_promise-with-resolvers-polyfill_promise-with-r-17c672-34345cb18aac.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_paths_index_ts-e4bfc7e9114d.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_ref-selector_RefSelector_tsx-7496afc3784d.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_commit-attribution_index_ts-ui_packages_commit-checks-status_index_ts-ui_packages-7094d4-15017f02e61c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_diffs_diff-parts_ts-b05d9274ce63.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_app-uuid_app-uuid_ts-ui_packages_document-metadata_document-metadata_ts-ui_packag-4d8de9-c9f824da1b03.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_code-view-shared_hooks_use-canonical-object_ts-ui_packages_code-view-shared_hooks-5f1d09-1ee828c2d6e8.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_blob-anchor_ts-ui_packages_code-nav_code-nav_ts-ui_packages_filter--8253c1-91468a3354f9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-code-view-7d3c75465807.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.2708311ccb5cb34358b1.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/react-code-view.a0633e3d36c876a6eaa1.module.css" /> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-subscriptions-menu-58a0c58bfee4.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.2708311ccb5cb34358b1.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/notifications-subscriptions-menu.1bcff9205c241e99cff2.module.css" /> <title>mesos/3rdparty/libprocess/README.md at master · apache/mesos · GitHub</title> <meta name="route-pattern" content="/:user_id/:repository/blob/*name(/*path)" data-turbo-transient> <meta name="route-controller" content="blob" data-turbo-transient> <meta name="route-action" content="show" data-turbo-transient> <meta name="current-catalog-service-hash" content="f3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb"> <meta name="request-id" content="B270:3CDFC2:4C1568:5B942F:67E4DB72" data-pjax-transient="true"/><meta name="html-safe-nonce" content="2c86458447d41b4620061ef018b0d599ccebe739e9d8035766ec80e4f000d821" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjcwOjNDREZDMjo0QzE1Njg6NUI5NDJGOjY3RTREQjcyIiwidmlzaXRvcl9pZCI6Ijc3MTE3MTY2MDM5OTE1Mzc4IiwicmVnaW9uX2VkZ2UiOiJzb3V0aGVhc3Rhc2lhIiwicmVnaW9uX3JlbmRlciI6InNvdXRoZWFzdGFzaWEifQ==" data-pjax-transient="true"/><meta name="visitor-hmac" content="85425750e0cbc57205337f447aed3edd641f39c8fe5120bcd30d2f2d2a7a54e1" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:11469439" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,source-code,file-tree,copilot" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <link rel="assets" href="https://github.githubassets.com/"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/<user-name>/<repo-name>/blob/show" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="Apache Mesos. Contribute to apache/mesos development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905, app-argument=https://github.com/apache/mesos/blob/master/3rdparty/libprocess/README.md" /> <meta name="twitter:image" content="https://opengraph.githubassets.com/ff6c7b592e886afab6cd3672fb455246f4311de76f3defd11a6e79efa4dbb75e/apache/mesos" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="mesos/3rdparty/libprocess/README.md at master · apache/mesos" /><meta name="twitter:description" content="Apache Mesos. Contribute to apache/mesos development by creating an account on GitHub." /> <meta property="og:image" content="https://opengraph.githubassets.com/ff6c7b592e886afab6cd3672fb455246f4311de76f3defd11a6e79efa4dbb75e/apache/mesos" /><meta property="og:image:alt" content="Apache Mesos. Contribute to apache/mesos development by creating an account on GitHub." /><meta property="og:image:width" content="1200" /><meta property="og:image:height" content="600" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="mesos/3rdparty/libprocess/README.md at master · apache/mesos" /><meta property="og:url" content="https://github.com/apache/mesos/blob/master/3rdparty/libprocess/README.md" /><meta property="og:description" content="Apache Mesos. Contribute to apache/mesos development by creating an account on GitHub." /> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta http-equiv="x-pjax-version" content="43d48ebc0aeb8da7e24d76441cdfec8f763d3d20c2dfbe2992450531b9b0cecf" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="77190eb53eb47fc30bd2fcc17a7eefa2dfd8505869fee9299ba911be3a40a9eb" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="911af613659f2a8ff08d51fd492330c9e8a6ed8f0c4eb3c6632db43599431d16" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="a512f9408e2c6e7c4ac5f57e22ffd863dc2e264e38455c3024733302983fa082" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta name="turbo-cache-control" content="no-cache" data-turbo-transient> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/apache/mesos git https://github.com/apache/mesos.git"> <meta name="octolytics-dimension-user_id" content="47359" /><meta name="octolytics-dimension-user_login" content="apache" /><meta name="octolytics-dimension-repository_id" content="11469439" /><meta name="octolytics-dimension-repository_nwo" content="apache/mesos" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="11469439" /><meta name="octolytics-dimension-repository_network_root_nwo" content="apache/mesos" /> <meta name="turbo-body-classes" content="logged-out env-production page-responsive"> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <meta name="release" content="db263e82ccd1ab4cbc49f684f9b34375718c76d3"> <link rel="mask-icon" href="https://github.githubassets.com/assets/pinned-octocat-093da3e6fa40.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg" data-base-href="https://github.githubassets.com/favicons/favicon"> <meta name="theme-color" content="#1e2327"> <meta name="color-scheme" content="light dark" /> <link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> </head> <body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div class="position-relative header-wrapper js-header-wrapper "> <a href="#start-of-content" data-skip-target-assigned="false" class="px-2 py-4 color-bg-accent-emphasis color-fg-on-emphasis show-on-focus js-skip-to-content">Skip to content</a> <span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full"> <span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis"></span> </span> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_ui-commands_ui-commands_ts-2ea4e93613c0.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/keyboard-shortcuts-dialog-33dfb803e078.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.2708311ccb5cb34358b1.module.css" /> <react-partial partial-name="keyboard-shortcuts-dialog" data-ssr="false" data-attempted-ssr="false" > <script type="application/json" data-target="react-partial.embeddedData">{"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}</script> <div data-target="react-partial.reactRoot"></div> </react-partial> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-4898d1bf4b51.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-730dca81d0a2.js"></script> <header class="HeaderMktg header-logged-out js-details-container js-header Details f4 py-3" role="banner" data-is-top="true" data-color-mode=light data-light-theme=light data-dark-theme=dark> <h2 class="sr-only">Navigation Menu</h2> <button type="button" class="HeaderMktg-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span class="d-none">Toggle navigation</span> </button> <div class="d-flex flex-column flex-lg-row flex-items-center px-3 px-md-4 px-lg-5 height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <div class="flex-1"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target js-nav-padding-recalculate js-header-menu-toggle Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span class="Button-content"> <span class="Button-label"><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span> </button> </div> <a class="mr-lg-3 color-fg-inherit flex-order-2 js-prevent-focus-on-mobile-nav" href="/" aria-label="Homepage" data-analytics-event="{"category":"Marketing nav","action":"click to go to homepage","label":"ref_page:Marketing;ref_cta:Logomark;ref_loc:Header"}"> <svg height="32" aria-hidden="true" viewBox="0 0 24 24" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"></path> </svg> </a> <div class="flex-1 flex-order-2 text-right"> <a href="/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fmesos%2Fblob%2Fmaster%2F3rdparty%2Flibprocess%2FREADME.md" class="HeaderMenu-link HeaderMenu-button d-inline-flex d-lg-none flex-order-1 f5 no-underline border color-border-default rounded-2 px-2 py-1 color-fg-inherit js-prevent-focus-on-mobile-nav" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"site header menu","repository_id":null,"auth_type":"SIGN_UP","originating_url":"https://github.com/apache/mesos/blob/master/3rdparty/libprocess/README.md","user_id":null}}" data-hydro-click-hmac="c10a7397471a0a5933798f141c74af32b271be40b202c2819f6f2e5b99b0953c" data-analytics-event="{"category":"Marketing nav","action":"click to Sign in","label":"ref_page:Marketing;ref_cta:Sign in;ref_loc:Header"}" > Sign in </a> </div> </div> <div class="HeaderMenu js-header-menu height-fit position-lg-relative d-lg-flex flex-column flex-auto top-0"> <div class="HeaderMenu-wrapper d-flex flex-column flex-self-start flex-lg-row flex-auto rounded rounded-lg-0"> <nav class="HeaderMenu-nav" aria-label="Global"> <ul class="d-lg-flex list-style-none"> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"github_copilot","context":"product","tag":"link","label":"github_copilot_link_product_navbar"}" href="https://github.com/features/copilot"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M23.922 16.992c-.861 1.495-5.859 5.023-11.922 5.023-6.063 0-11.061-3.528-11.922-5.023A.641.641 0 0 1 0 16.736v-2.869a.841.841 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952 1.399-1.136 3.392-2.093 6.122-2.093 2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.832.832 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256ZM12.172 11h-.344a4.323 4.323 0 0 1-.355.508C10.703 12.455 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a2.005 2.005 0 0 1-.085-.104L4 11.741v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.016.016Zm.641-2.935c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"></path><path d="M14.5 14.25a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Zm-5 0a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Z"></path> </svg> <div> <div class="color-fg-default h4">GitHub Copilot</div> Write better code with AI </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"security","context":"product","tag":"link","label":"security_link_product_navbar"}" href="https://github.com/features/security"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path> </svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"actions","context":"product","tag":"link","label":"actions_link_product_navbar"}" href="https://github.com/features/actions"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path> </svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"codespaces","context":"product","tag":"link","label":"codespaces_link_product_navbar"}" href="https://github.com/features/codespaces"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path> </svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"issues","context":"product","tag":"link","label":"issues_link_product_navbar"}" href="https://github.com/features/issues"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path> </svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"code_review","context":"product","tag":"link","label":"code_review_link_product_navbar"}" href="https://github.com/features/code-review"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path> </svg> <div> <div class="color-fg-default h4">Code Review</div> Manage code changes </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"discussions","context":"product","tag":"link","label":"discussions_link_product_navbar"}" href="https://github.com/features/discussions"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path> </svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{"location":"navbar","action":"code_search","context":"product","tag":"link","label":"code_search_link_product_navbar"}" href="https://github.com/features/code-search"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-square color-fg-subtle mr-3"> <path d="M10.3 8.24a.75.75 0 0 1-.04 1.06L7.352 12l2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M2 3.75C2 2.784 2.784 2 3.75 2h16.5c.966 0 1.75.784 1.75 1.75v16.5A1.75 1.75 0 0 1 20.25 22H3.75A1.75 1.75 0 0 1 2 20.25Zm1.75-.25a.25.25 0 0 0-.25.25v16.5c0 .138.112.25.25.25h16.5a.25.25 0 0 0 .25-.25V3.75a.25.25 0 0 0-.25-.25Z"></path> </svg> <div> <div class="color-fg-default h4">Code Search</div> Find more, search less </div> </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="product-explore-heading">Explore</span> <ul class="list-style-none f5" aria-labelledby="product-explore-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"all_features","context":"product","tag":"link","label":"all_features_link_product_navbar"}" href="https://github.com/features"> All features </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{"location":"navbar","action":"documentation","context":"product","tag":"link","label":"documentation_link_product_navbar"}" href="https://docs.github.com"> Documentation <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{"location":"navbar","action":"github_skills","context":"product","tag":"link","label":"github_skills_link_product_navbar"}" href="https://skills.github.com"> GitHub Skills <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{"location":"navbar","action":"blog","context":"product","tag":"link","label":"blog_link_product_navbar"}" href="https://github.blog"> Blog <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 pb-lg-3 mb-3 mb-lg-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-company-size-heading">By company size</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-company-size-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"enterprises","context":"solutions","tag":"link","label":"enterprises_link_solutions_navbar"}" href="https://github.com/enterprise"> Enterprises </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"small_and_medium_teams","context":"solutions","tag":"link","label":"small_and_medium_teams_link_solutions_navbar"}" href="https://github.com/team"> Small and medium teams </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"startups","context":"solutions","tag":"link","label":"startups_link_solutions_navbar"}" href="https://github.com/enterprise/startups"> Startups </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"nonprofits","context":"solutions","tag":"link","label":"nonprofits_link_solutions_navbar"}" href="/solutions/industry/nonprofits"> Nonprofits </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-use-case-heading">By use case</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-use-case-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"devsecops","context":"solutions","tag":"link","label":"devsecops_link_solutions_navbar"}" href="/solutions/use-case/devsecops"> DevSecOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"devops","context":"solutions","tag":"link","label":"devops_link_solutions_navbar"}" href="/solutions/use-case/devops"> DevOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"ci_cd","context":"solutions","tag":"link","label":"ci_cd_link_solutions_navbar"}" href="/solutions/use-case/ci-cd"> CI/CD </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"view_all_use_cases","context":"solutions","tag":"link","label":"view_all_use_cases_link_solutions_navbar"}" href="/solutions/use-case"> View all use cases </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-industry-heading">By industry</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-industry-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"healthcare","context":"solutions","tag":"link","label":"healthcare_link_solutions_navbar"}" href="/solutions/industry/healthcare"> Healthcare </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"financial_services","context":"solutions","tag":"link","label":"financial_services_link_solutions_navbar"}" href="/solutions/industry/financial-services"> Financial services </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"manufacturing","context":"solutions","tag":"link","label":"manufacturing_link_solutions_navbar"}" href="/solutions/industry/manufacturing"> Manufacturing </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"government","context":"solutions","tag":"link","label":"government_link_solutions_navbar"}" href="/solutions/industry/government"> Government </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"view_all_industries","context":"solutions","tag":"link","label":"view_all_industries_link_solutions_navbar"}" href="/solutions/industry"> View all industries </a></li> </ul> </div> </div> <div class="HeaderMenu-trailing-link rounded-bottom-2 flex-shrink-0 mt-lg-4 px-lg-4 py-4 py-lg-3 f5 text-semibold"> <a href="/solutions"> View all solutions <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-right HeaderMenu-trailing-link-icon"> <path d="M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z"></path> </svg> </a> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Resources <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="resources-topics-heading">Topics</span> <ul class="list-style-none f5" aria-labelledby="resources-topics-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"ai","context":"resources","tag":"link","label":"ai_link_resources_navbar"}" href="/resources/articles/ai"> AI </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"devops","context":"resources","tag":"link","label":"devops_link_resources_navbar"}" href="/resources/articles/devops"> DevOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"security","context":"resources","tag":"link","label":"security_link_resources_navbar"}" href="/resources/articles/security"> Security </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"software_development","context":"resources","tag":"link","label":"software_development_link_resources_navbar"}" href="/resources/articles/software-development"> Software Development </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"view_all","context":"resources","tag":"link","label":"view_all_link_resources_navbar"}" href="/resources/articles"> View all </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="resources-explore-heading">Explore</span> <ul class="list-style-none f5" aria-labelledby="resources-explore-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{"location":"navbar","action":"learning_pathways","context":"resources","tag":"link","label":"learning_pathways_link_resources_navbar"}" href="https://resources.github.com/learn/pathways"> Learning Pathways <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{"location":"navbar","action":"events_amp_webinars","context":"resources","tag":"link","label":"events_amp_webinars_link_resources_navbar"}" href="https://resources.github.com"> Events & Webinars <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"ebooks_amp_whitepapers","context":"resources","tag":"link","label":"ebooks_amp_whitepapers_link_resources_navbar"}" href="https://github.com/resources/whitepapers"> Ebooks & Whitepapers </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"customer_stories","context":"resources","tag":"link","label":"customer_stories_link_resources_navbar"}" href="https://github.com/customer-stories"> Customer Stories </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{"location":"navbar","action":"partners","context":"resources","tag":"link","label":"partners_link_resources_navbar"}" href="https://partner.github.com"> Partners <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"executive_insights","context":"resources","tag":"link","label":"executive_insights_link_resources_navbar"}" href="https://github.com/solutions/executive-insights"> Executive Insights </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 px-lg-4"> <div class="HeaderMenu-column"> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{"location":"navbar","action":"github_sponsors","context":"open_source","tag":"link","label":"github_sponsors_link_open_source_navbar"}" href="/sponsors"> <div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{"location":"navbar","action":"the_readme_project","context":"open_source","tag":"link","label":"the_readme_project_link_open_source_navbar"}" href="https://github.com/readme"> <div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="open-source-repositories-heading">Repositories</span> <ul class="list-style-none f5" aria-labelledby="open-source-repositories-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"topics","context":"open_source","tag":"link","label":"topics_link_open_source_navbar"}" href="https://github.com/topics"> Topics </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"trending","context":"open_source","tag":"link","label":"trending_link_open_source_navbar"}" href="https://github.com/trending"> Trending </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{"location":"navbar","action":"collections","context":"open_source","tag":"link","label":"collections_link_open_source_navbar"}" href="https://github.com/collections"> Collections </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Enterprise <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 px-lg-4"> <div class="HeaderMenu-column"> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{"location":"navbar","action":"enterprise_platform","context":"enterprise","tag":"link","label":"enterprise_platform_link_enterprise_navbar"}" href="/enterprise"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-stack color-fg-subtle mr-3"> <path d="M11.063 1.456a1.749 1.749 0 0 1 1.874 0l8.383 5.316a1.751 1.751 0 0 1 0 2.956l-8.383 5.316a1.749 1.749 0 0 1-1.874 0L2.68 9.728a1.751 1.751 0 0 1 0-2.956Zm1.071 1.267a.25.25 0 0 0-.268 0L3.483 8.039a.25.25 0 0 0 0 .422l8.383 5.316a.25.25 0 0 0 .268 0l8.383-5.316a.25.25 0 0 0 0-.422Z"></path><path d="M1.867 12.324a.75.75 0 0 1 1.035-.232l8.964 5.685a.25.25 0 0 0 .268 0l8.964-5.685a.75.75 0 0 1 .804 1.267l-8.965 5.685a1.749 1.749 0 0 1-1.874 0l-8.965-5.685a.75.75 0 0 1-.231-1.035Z"></path><path d="M1.867 16.324a.75.75 0 0 1 1.035-.232l8.964 5.685a.25.25 0 0 0 .268 0l8.964-5.685a.75.75 0 0 1 .804 1.267l-8.965 5.685a1.749 1.749 0 0 1-1.874 0l-8.965-5.685a.75.75 0 0 1-.231-1.035Z"></path> </svg> <div> <div class="color-fg-default h4">Enterprise platform</div> AI-powered developer platform </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="enterprise-available-add-ons-heading">Available add-ons</span> <ul class="list-style-none f5" aria-labelledby="enterprise-available-add-ons-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"advanced_security","context":"enterprise","tag":"link","label":"advanced_security_link_enterprise_navbar"}" href="https://github.com/enterprise/advanced-security"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path> </svg> <div> <div class="color-fg-default h4">Advanced Security</div> Enterprise-grade security features </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{"location":"navbar","action":"copilot_for_business","context":"enterprise","tag":"link","label":"copilot_for_business_link_enterprise_navbar"}" href="/features/copilot/copilot-business"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M23.922 16.992c-.861 1.495-5.859 5.023-11.922 5.023-6.063 0-11.061-3.528-11.922-5.023A.641.641 0 0 1 0 16.736v-2.869a.841.841 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952 1.399-1.136 3.392-2.093 6.122-2.093 2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.832.832 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256ZM12.172 11h-.344a4.323 4.323 0 0 1-.355.508C10.703 12.455 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a2.005 2.005 0 0 1-.085-.104L4 11.741v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.016.016Zm.641-2.935c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"></path><path d="M14.5 14.25a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Zm-5 0a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Z"></path> </svg> <div> <div class="color-fg-default h4">Copilot for business</div> Enterprise-grade AI features </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{"location":"navbar","action":"premium_support","context":"enterprise","tag":"link","label":"premium_support_link_enterprise_navbar"}" href="/premium-support"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path> </svg> <div> <div class="color-fg-default h4">Premium Support</div> Enterprise-grade 24/7 support </div> </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <a class="HeaderMenu-link no-underline px-0 px-lg-2 py-3 py-lg-2 d-block d-lg-inline-block" data-analytics-event="{"location":"navbar","action":"pricing","context":"global","tag":"link","label":"pricing_link_global_navbar"}" href="https://github.com/pricing">Pricing</a> </li> </ul> </nav> <div class="d-flex flex-column flex-lg-row width-full flex-justify-end flex-lg-items-center text-center mt-3 mt-lg-0 text-lg-left ml-lg-3"> <qbsearch-input class="search-input" data-scope="repo:apache/mesos" data-custom-scopes-path="/search/custom_scopes" data-delete-custom-scopes-csrf="zJDD-f3iySQPioBLvZIgmf-MCLn4kLtWsBYUABqGTUd7TK0MAX3mG8Ff_dB45fgEPXrbVreDy1-b2cvK941WSw" data-max-custom-scopes="10" data-header-redesign-enabled="false" data-initial-value="" data-blackbird-suggestions-path="/search/suggestions" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" data-current-repository="apache/mesos" data-current-org="apache" data-current-owner="" data-logged-in="false" data-copilot-chat-enabled="false" data-nl-search-enabled="false" data-retain-scroll-position="true"> <div class="search-input-container search-with-dialog position-relative d-flex flex-row flex-items-center mr-4 rounded" data-action="click:qbsearch-input#searchInputContainerClicked" > <button type="button" class="header-search-button placeholder input-button form-control d-flex flex-1 flex-self-stretch flex-items-center no-wrap width-full py-0 pl-2 pr-0 text-left border-0 box-shadow-none" data-target="qbsearch-input.inputButton" aria-label="Search or jump to…" aria-haspopup="dialog" placeholder="Search or jump to..." data-hotkey=s,/ autocapitalize="off" data-analytics-event="{"location":"navbar","action":"searchbar","context":"global","tag":"input","label":"searchbar_input_global_navbar"}" data-action="click:qbsearch-input#handleExpand" > <div class="mr-2 color-fg-muted"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </div> <span class="flex-1" data-target="qbsearch-input.inputButtonText">Search or jump to...</span> <div class="d-flex" data-target="qbsearch-input.hotkeyIndicator"> <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg> </div> </button> <input type="hidden" name="type" class="js-site-search-type-field"> <div class="Overlay--hidden " data-modal-dialog-overlay> <modal-dialog data-action="close:qbsearch-input#handleClose cancel:qbsearch-input#handleClose" data-target="qbsearch-input.searchSuggestionsDialog" role="dialog" id="search-suggestions-dialog" aria-modal="true" aria-labelledby="search-suggestions-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto"> <h1 id="search-suggestions-dialog-header" class="sr-only">Search code, repositories, users, issues, pull requests...</h1> <div class="Overlay-body Overlay-body--paddingNone"> <div data-view-component="true"> <div class="search-suggestions position-fixed width-full color-shadow-large border color-fg-default color-bg-default overflow-hidden d-flex flex-column query-builder-container" style="border-radius: 12px;" data-target="qbsearch-input.queryBuilderContainer" hidden > <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="query-builder-test-form" action="" accept-charset="UTF-8" method="get"> <query-builder data-target="qbsearch-input.queryBuilder" id="query-builder-query-builder-test" data-filter-key=":" data-view-component="true" class="QueryBuilder search-query-builder"> <div class="FormControl FormControl--fullWidth"> <label id="query-builder-test-label" for="query-builder-test" class="FormControl-label sr-only"> Search </label> <div class="QueryBuilder-StyledInput width-fit " data-target="query-builder.styledInput" > <span id="query-builder-test-leadingvisual-wrap" class="FormControl-input-leadingVisualWrap QueryBuilder-leadingVisualWrap"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search FormControl-input-leadingVisual"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </span> <div data-target="query-builder.styledInputContainer" class="QueryBuilder-StyledInputContainer"> <div aria-hidden="true" class="QueryBuilder-StyledInputContent" data-target="query-builder.styledInputContent" ></div> <div class="QueryBuilder-InputWrapper"> <div aria-hidden="true" class="QueryBuilder-Sizer" data-target="query-builder.sizer"></div> <input id="query-builder-test" name="query-builder-test" value="" autocomplete="off" type="text" role="combobox" spellcheck="false" aria-expanded="false" aria-describedby="validation-c6726f10-b3d6-4f32-903d-f235d9a21811" data-target="query-builder.input" data-action=" input:query-builder#inputChange blur:query-builder#inputBlur keydown:query-builder#inputKeydown focus:query-builder#inputFocus " data-view-component="true" class="FormControl-input QueryBuilder-Input FormControl-medium" /> </div> </div> <span class="sr-only" id="query-builder-test-clear">Clear</span> <button role="button" id="query-builder-test-clear-button" aria-labelledby="query-builder-test-clear query-builder-test-label" data-target="query-builder.clearButton" data-action=" click:query-builder#clear focus:query-builder#clearButtonFocus blur:query-builder#clearButtonBlur " variant="small" hidden="hidden" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium mr-1 px-2 py-0 d-flex flex-items-center rounded-1 color-fg-muted"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x-circle-fill Button-visual"> <path d="M2.343 13.657A8 8 0 1 1 13.658 2.343 8 8 0 0 1 2.343 13.657ZM6.03 4.97a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042L6.94 8 4.97 9.97a.749.749 0 0 0 .326 1.275.749.749 0 0 0 .734-.215L8 9.06l1.97 1.97a.749.749 0 0 0 1.275-.326.749.749 0 0 0-.215-.734L9.06 8l1.97-1.97a.749.749 0 0 0-.326-1.275.749.749 0 0 0-.734.215L8 6.94Z"></path> </svg> </button> </div> <template id="search-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </template> <template id="code-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </template> <template id="file-code-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file-code"> <path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0Zm1.72 4.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.47-1.47-1.47-1.47a.75.75 0 0 1 0-1.06ZM3.28 7.78 1.81 9.25l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Zm8.22-6.218V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path> </svg> </template> <template id="history-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path> </svg> </template> <template id="repo-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> </template> <template id="bookmark-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bookmark"> <path d="M3 2.75C3 1.784 3.784 1 4.75 1h6.5c.966 0 1.75.784 1.75 1.75v11.5a.75.75 0 0 1-1.227.579L8 11.722l-3.773 3.107A.751.751 0 0 1 3 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.91l3.023-2.489a.75.75 0 0 1 .954 0l3.023 2.49V2.75a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="plus-circle-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-plus-circle"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm7.25-3.25v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5a.75.75 0 0 1 1.5 0Z"></path> </svg> </template> <template id="circle-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> </template> <template id="trash-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-trash"> <path d="M11 1.75V3h2.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5H5V1.75C5 .784 5.784 0 6.75 0h2.5C10.216 0 11 .784 11 1.75ZM4.496 6.675l.66 6.6a.25.25 0 0 0 .249.225h5.19a.25.25 0 0 0 .249-.225l.66-6.6a.75.75 0 0 1 1.492.149l-.66 6.6A1.748 1.748 0 0 1 10.595 15h-5.19a1.75 1.75 0 0 1-1.741-1.575l-.66-6.6a.75.75 0 1 1 1.492-.15ZM6.5 1.75V3h3V1.75a.25.25 0 0 0-.25-.25h-2.5a.25.25 0 0 0-.25.25Z"></path> </svg> </template> <template id="team-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-people"> <path d="M2 5.5a3.5 3.5 0 1 1 5.898 2.549 5.508 5.508 0 0 1 3.034 4.084.75.75 0 1 1-1.482.235 4 4 0 0 0-7.9 0 .75.75 0 0 1-1.482-.236A5.507 5.507 0 0 1 3.102 8.05 3.493 3.493 0 0 1 2 5.5ZM11 4a3.001 3.001 0 0 1 2.22 5.018 5.01 5.01 0 0 1 2.56 3.012.749.749 0 0 1-.885.954.752.752 0 0 1-.549-.514 3.507 3.507 0 0 0-2.522-2.372.75.75 0 0 1-.574-.73v-.352a.75.75 0 0 1 .416-.672A1.5 1.5 0 0 0 11 5.5.75.75 0 0 1 11 4Zm-5.5-.5a2 2 0 1 0-.001 3.999A2 2 0 0 0 5.5 3.5Z"></path> </svg> </template> <template id="project-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path> </svg> </template> <template id="pencil-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-pencil"> <path d="M11.013 1.427a1.75 1.75 0 0 1 2.474 0l1.086 1.086a1.75 1.75 0 0 1 0 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 0 1-.927-.928l.929-3.25c.081-.286.235-.547.445-.758l8.61-8.61Zm.176 4.823L9.75 4.81l-6.286 6.287a.253.253 0 0 0-.064.108l-.558 1.953 1.953-.558a.253.253 0 0 0 .108-.064Zm1.238-3.763a.25.25 0 0 0-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 0 0 0-.354Z"></path> </svg> </template> <template id="copilot-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copilot"> <path d="M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z"></path><path d="M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z"></path> </svg> </template> <template id="copilot-error-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copilot-error"> <path d="M16 11.24c0 .112-.072.274-.21.467L13 9.688V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-.198 0-.388-.009-.571-.029L6.833 5.226a4.01 4.01 0 0 0 .17-.782c.117-.935-.037-1.395-.241-1.614-.193-.206-.637-.413-1.682-.297-.683.076-1.115.231-1.395.415l-1.257-.91c.579-.564 1.413-.877 2.485-.996 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095Zm-5.083-8.707c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Zm2.511 11.074c-1.393.776-3.272 1.428-5.43 1.428-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.18-.455-.241-.963-.252-1.475L.31 4.107A.747.747 0 0 1 0 3.509V3.49a.748.748 0 0 1 .625-.73c.156-.026.306.047.435.139l14.667 10.578a.592.592 0 0 1 .227.264.752.752 0 0 1 .046.249v.022a.75.75 0 0 1-1.19.596Zm-1.367-.991L5.635 7.964a5.128 5.128 0 0 1-.889.073c-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433 1.539 0 3.089-.505 4.063-.934Z"></path> </svg> </template> <template id="workflow-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-workflow"> <path d="M0 1.75C0 .784.784 0 1.75 0h3.5C6.216 0 7 .784 7 1.75v3.5A1.75 1.75 0 0 1 5.25 7H4v4a1 1 0 0 0 1 1h4v-1.25C9 9.784 9.784 9 10.75 9h3.5c.966 0 1.75.784 1.75 1.75v3.5A1.75 1.75 0 0 1 14.25 16h-3.5A1.75 1.75 0 0 1 9 14.25v-.75H5A2.5 2.5 0 0 1 2.5 11V7h-.75A1.75 1.75 0 0 1 0 5.25Zm1.75-.25a.25.25 0 0 0-.25.25v3.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-3.5a.25.25 0 0 0-.25-.25Zm9 9a.25.25 0 0 0-.25.25v3.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-3.5a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="book-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book"> <path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path> </svg> </template> <template id="code-review-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code-review"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 13H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25v-8.5C0 1.784.784 1 1.75 1ZM1.5 2.75v8.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm5.28 1.72a.75.75 0 0 1 0 1.06L5.31 7l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.75.75 0 0 1 1.06 0Zm2.44 0a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L10.69 7 9.22 5.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </template> <template id="codespaces-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-codespaces"> <path d="M0 11.25c0-.966.784-1.75 1.75-1.75h12.5c.966 0 1.75.784 1.75 1.75v3A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm2-9.5C2 .784 2.784 0 3.75 0h8.5C13.216 0 14 .784 14 1.75v5a1.75 1.75 0 0 1-1.75 1.75h-8.5A1.75 1.75 0 0 1 2 6.75Zm1.75-.25a.25.25 0 0 0-.25.25v5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-5a.25.25 0 0 0-.25-.25Zm-2 9.5a.25.25 0 0 0-.25.25v3c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-3a.25.25 0 0 0-.25-.25Z"></path><path d="M7 12.75a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path> </svg> </template> <template id="comment-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment"> <path d="M1 2.75C1 1.784 1.784 1 2.75 1h10.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 13.25 12H9.06l-2.573 2.573A1.458 1.458 0 0 1 4 13.543V12H2.75A1.75 1.75 0 0 1 1 10.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h4.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="comment-discussion-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment-discussion"> <path d="M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z"></path> </svg> </template> <template id="organization-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-organization"> <path d="M1.75 16A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0h8.5C11.216 0 12 .784 12 1.75v12.5c0 .085-.006.168-.018.25h2.268a.25.25 0 0 0 .25-.25V8.285a.25.25 0 0 0-.111-.208l-1.055-.703a.749.749 0 1 1 .832-1.248l1.055.703c.487.325.779.871.779 1.456v5.965A1.75 1.75 0 0 1 14.25 16h-3.5a.766.766 0 0 1-.197-.026c-.099.017-.2.026-.303.026h-3a.75.75 0 0 1-.75-.75V14h-1v1.25a.75.75 0 0 1-.75.75Zm-.25-1.75c0 .138.112.25.25.25H4v-1.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 .75.75v1.25h2.25a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25ZM3.75 6h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 3.75A.75.75 0 0 1 3.75 3h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 3.75Zm4 3A.75.75 0 0 1 7.75 6h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 7 6.75ZM7.75 3h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 9.75A.75.75 0 0 1 3.75 9h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 9.75ZM7.75 9h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z"></path> </svg> </template> <template id="rocket-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-rocket"> <path d="M14.064 0h.186C15.216 0 16 .784 16 1.75v.186a8.752 8.752 0 0 1-2.564 6.186l-.458.459c-.314.314-.641.616-.979.904v3.207c0 .608-.315 1.172-.833 1.49l-2.774 1.707a.749.749 0 0 1-1.11-.418l-.954-3.102a1.214 1.214 0 0 1-.145-.125L3.754 9.816a1.218 1.218 0 0 1-.124-.145L.528 8.717a.749.749 0 0 1-.418-1.11l1.71-2.774A1.748 1.748 0 0 1 3.31 4h3.204c.288-.338.59-.665.904-.979l.459-.458A8.749 8.749 0 0 1 14.064 0ZM8.938 3.623h-.002l-.458.458c-.76.76-1.437 1.598-2.02 2.5l-1.5 2.317 2.143 2.143 2.317-1.5c.902-.583 1.74-1.26 2.499-2.02l.459-.458a7.25 7.25 0 0 0 2.123-5.127V1.75a.25.25 0 0 0-.25-.25h-.186a7.249 7.249 0 0 0-5.125 2.123ZM3.56 14.56c-.732.732-2.334 1.045-3.005 1.148a.234.234 0 0 1-.201-.064.234.234 0 0 1-.064-.201c.103-.671.416-2.273 1.15-3.003a1.502 1.502 0 1 1 2.12 2.12Zm6.94-3.935c-.088.06-.177.118-.266.175l-2.35 1.521.548 1.783 1.949-1.2a.25.25 0 0 0 .119-.213ZM3.678 8.116 5.2 5.766c.058-.09.117-.178.176-.266H3.309a.25.25 0 0 0-.213.119l-1.2 1.95ZM12 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </template> <template id="shield-check-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield-check"> <path d="m8.533.133 5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667l5.25-1.68a1.748 1.748 0 0 1 1.066 0Zm-.61 1.429.001.001-5.25 1.68a.251.251 0 0 0-.174.237V7c0 1.36.275 2.666 1.057 3.859.784 1.194 2.121 2.342 4.366 3.298a.196.196 0 0 0 .154 0c2.245-.957 3.582-2.103 4.366-3.297C13.225 9.666 13.5 8.358 13.5 7V3.48a.25.25 0 0 0-.174-.238l-5.25-1.68a.25.25 0 0 0-.153 0ZM11.28 6.28l-3.5 3.5a.75.75 0 0 1-1.06 0l-1.5-1.5a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l.97.97 2.97-2.97a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </template> <template id="heart-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-heart"> <path d="m8 14.25.345.666a.75.75 0 0 1-.69 0l-.008-.004-.018-.01a7.152 7.152 0 0 1-.31-.17 22.055 22.055 0 0 1-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.066 22.066 0 0 1-3.744 2.584l-.018.01-.006.003h-.002ZM4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.58 20.58 0 0 0 8 13.393a20.58 20.58 0 0 0 3.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.749.749 0 0 1-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5Z"></path> </svg> </template> <template id="server-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-server"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v4c0 .372-.116.717-.314 1 .198.283.314.628.314 1v4a1.75 1.75 0 0 1-1.75 1.75H1.75A1.75 1.75 0 0 1 0 12.75v-4c0-.358.109-.707.314-1a1.739 1.739 0 0 1-.314-1v-4C0 1.784.784 1 1.75 1ZM1.5 2.75v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm.25 5.75a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25ZM7 4.75A.75.75 0 0 1 7.75 4h4.5a.75.75 0 0 1 0 1.5h-4.5A.75.75 0 0 1 7 4.75ZM7.75 10h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM3 4.75A.75.75 0 0 1 3.75 4h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 4.75ZM3.75 10h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z"></path> </svg> </template> <template id="globe-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-globe"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM5.78 8.75a9.64 9.64 0 0 0 1.363 4.177c.255.426.542.832.857 1.215.245-.296.551-.705.857-1.215A9.64 9.64 0 0 0 10.22 8.75Zm4.44-1.5a9.64 9.64 0 0 0-1.363-4.177c-.307-.51-.612-.919-.857-1.215a9.927 9.927 0 0 0-.857 1.215A9.64 9.64 0 0 0 5.78 7.25Zm-5.944 1.5H1.543a6.507 6.507 0 0 0 4.666 5.5c-.123-.181-.24-.365-.352-.552-.715-1.192-1.437-2.874-1.581-4.948Zm-2.733-1.5h2.733c.144-2.074.866-3.756 1.58-4.948.12-.197.237-.381.353-.552a6.507 6.507 0 0 0-4.666 5.5Zm10.181 1.5c-.144 2.074-.866 3.756-1.58 4.948-.12.197-.237.381-.353.552a6.507 6.507 0 0 0 4.666-5.5Zm2.733-1.5a6.507 6.507 0 0 0-4.666-5.5c.123.181.24.365.353.552.714 1.192 1.436 2.874 1.58 4.948Z"></path> </svg> </template> <template id="issue-opened-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> </svg> </template> <template id="device-mobile-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-device-mobile"> <path d="M3.75 0h8.5C13.216 0 14 .784 14 1.75v12.5A1.75 1.75 0 0 1 12.25 16h-8.5A1.75 1.75 0 0 1 2 14.25V1.75C2 .784 2.784 0 3.75 0ZM3.5 1.75v12.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25ZM8 13a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path> </svg> </template> <template id="package-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-package"> <path d="m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z"></path> </svg> </template> <template id="credit-card-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-credit-card"> <path d="M10.75 9a.75.75 0 0 0 0 1.5h1.5a.75.75 0 0 0 0-1.5h-1.5Z"></path><path d="M0 3.75C0 2.784.784 2 1.75 2h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14H1.75A1.75 1.75 0 0 1 0 12.25ZM14.5 6.5h-13v5.75c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25Zm0-2.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25V5h13Z"></path> </svg> </template> <template id="play-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> </template> <template id="gift-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-gift"> <path d="M2 2.75A2.75 2.75 0 0 1 4.75 0c.983 0 1.873.42 2.57 1.232.268.318.497.668.68 1.042.183-.375.411-.725.68-1.044C9.376.42 10.266 0 11.25 0a2.75 2.75 0 0 1 2.45 4h.55c.966 0 1.75.784 1.75 1.75v2c0 .698-.409 1.301-1 1.582v4.918A1.75 1.75 0 0 1 13.25 16H2.75A1.75 1.75 0 0 1 1 14.25V9.332C.409 9.05 0 8.448 0 7.75v-2C0 4.784.784 4 1.75 4h.55c-.192-.375-.3-.8-.3-1.25ZM7.25 9.5H2.5v4.75c0 .138.112.25.25.25h4.5Zm1.5 0v5h4.5a.25.25 0 0 0 .25-.25V9.5Zm0-4V8h5.5a.25.25 0 0 0 .25-.25v-2a.25.25 0 0 0-.25-.25Zm-7 0a.25.25 0 0 0-.25.25v2c0 .138.112.25.25.25h5.5V5.5h-5.5Zm3-4a1.25 1.25 0 0 0 0 2.5h2.309c-.233-.818-.542-1.401-.878-1.793-.43-.502-.915-.707-1.431-.707ZM8.941 4h2.309a1.25 1.25 0 0 0 0-2.5c-.516 0-1 .205-1.43.707-.337.392-.646.975-.879 1.793Z"></path> </svg> </template> <template id="code-square-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code-square"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25Zm7.47 3.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L10.69 8 9.22 6.53a.75.75 0 0 1 0-1.06ZM6.78 6.53 5.31 8l1.47 1.47a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </template> <template id="device-desktop-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-device-desktop"> <path d="M14.25 1c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.752.752 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5C0 1.784.784 1 1.75 1ZM1.75 2.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25ZM9.018 12H6.982a5.72 5.72 0 0 1-.765 2.5h3.566a5.72 5.72 0 0 1-.765-2.5Z"></path> </svg> </template> <div class="position-relative"> <ul role="listbox" class="ActionListWrap QueryBuilder-ListWrap" aria-label="Suggestions" data-action=" combobox-commit:query-builder#comboboxCommit mousedown:query-builder#resultsMousedown " data-target="query-builder.resultsList" data-persist-list=false id="query-builder-test-results" ></ul> </div> <div class="FormControl-inlineValidation" id="validation-c6726f10-b3d6-4f32-903d-f235d9a21811" hidden="hidden"> <span class="FormControl-inlineValidation--visual"> <svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-alert-fill"> <path d="M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path> </svg> </span> <span></span> </div> </div> <div data-target="query-builder.screenReaderFeedback" aria-live="polite" aria-atomic="true" class="sr-only"></div> </query-builder></form> <div class="d-flex flex-row color-fg-muted px-3 text-small color-bg-default search-feedback-prompt"> <a target="_blank" href="https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax" data-view-component="true" class="Link color-fg-accent text-normal ml-2">Search syntax tips</a> <div class="d-flex flex-1"></div> </div> </div> </div> </div> </modal-dialog></div> </div> <div data-action="click:qbsearch-input#retract" class="dark-backdrop position-fixed" hidden data-target="qbsearch-input.darkBackdrop"></div> <div class="color-fg-default"> <dialog-helper> <dialog data-target="qbsearch-input.feedbackDialog" data-action="close:qbsearch-input#handleDialogClose cancel:qbsearch-input#handleDialogClose" id="feedback-dialog" aria-modal="true" aria-labelledby="feedback-dialog-title" aria-describedby="feedback-dialog-description" data-view-component="true" class="Overlay Overlay-whenNarrow Overlay--size-medium Overlay--motion-scaleFade Overlay--disableScroll"> <div data-view-component="true" class="Overlay-header"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 class="Overlay-title " id="feedback-dialog-title"> Provide feedback </h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="feedback-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg></button> </div> </div> </div> <scrollable-region data-labelled-by="feedback-dialog-title"> <div data-view-component="true" class="Overlay-body"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="code-search-feedback-form" data-turbo="false" action="/search/feedback" accept-charset="UTF-8" method="post"><input type="hidden" data-csrf="true" name="authenticity_token" value="z2hcn6+xu//tW48weHNyw0bolj9jlehHdYshMnN/ffRWkRyo6EjObeQDNfK6Q6GXX9fOZ2T9Lf76vyJRtAL8Pw==" /> <p>We read every piece of feedback, and take your input very seriously.</p> <textarea name="feedback" class="form-control width-full mb-2" style="height: 120px" id="feedback"></textarea> <input name="include_email" id="include_email" aria-label="Include my email address so I can be contacted" class="form-control mr-2" type="checkbox"> <label for="include_email" style="font-weight: normal">Include my email address so I can be contacted</label> </form></div> </scrollable-region> <div data-view-component="true" class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="feedback-dialog" type="button" data-view-component="true" class="btn"> Cancel </button> <button form="code-search-feedback-form" data-action="click:qbsearch-input#submitFeedback" type="submit" data-view-component="true" class="btn-primary btn"> Submit feedback </button> </div> </dialog></dialog-helper> <custom-scopes data-target="qbsearch-input.customScopesManager"> <dialog-helper> <dialog data-target="custom-scopes.customScopesModalDialog" data-action="close:qbsearch-input#handleDialogClose cancel:qbsearch-input#handleDialogClose" id="custom-scopes-dialog" aria-modal="true" aria-labelledby="custom-scopes-dialog-title" aria-describedby="custom-scopes-dialog-description" data-view-component="true" class="Overlay Overlay-whenNarrow Overlay--size-medium Overlay--motion-scaleFade Overlay--disableScroll"> <div data-view-component="true" class="Overlay-header Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 class="Overlay-title " id="custom-scopes-dialog-title"> Saved searches </h1> <h2 id="custom-scopes-dialog-description" class="Overlay-description">Use saved searches to filter your results more quickly</h2> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="custom-scopes-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg></button> </div> </div> </div> <scrollable-region data-labelled-by="custom-scopes-dialog-title"> <div data-view-component="true" class="Overlay-body"> <div data-target="custom-scopes.customScopesModalDialogFlash"></div> <div hidden class="create-custom-scope-form" data-target="custom-scopes.createCustomScopeForm"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="custom-scopes-dialog-form" data-turbo="false" action="/search/custom_scopes" accept-charset="UTF-8" method="post"><input type="hidden" data-csrf="true" name="authenticity_token" value="oN6QfsZKQggfM94OVpuwWPtovPrJfIb2KJCoSksXLkZLUDfZZKD95WPy7jp8HZJj6LQqMcXpkloUYy4Nhc+2Ww==" /> <div data-target="custom-scopes.customScopesModalDialogFlash"></div> <input type="hidden" id="custom_scope_id" name="custom_scope_id" data-target="custom-scopes.customScopesIdField"> <div class="form-group"> <label for="custom_scope_name">Name</label> <auto-check src="/search/custom_scopes/check_name" required only-validate-on-blur="false"> <input type="text" name="custom_scope_name" id="custom_scope_name" data-target="custom-scopes.customScopesNameField" class="form-control" autocomplete="off" placeholder="github-ruby" required maxlength="50"> <input type="hidden" data-csrf="true" value="8g+XpMpAJfr8gFuEobub7e2lUXWvLCP1X38YDY/dYuGMDvIZ6Q1CxJKnBAW8TRTGCGYXR5qwhvMy6vBfgKs0iw==" /> </auto-check> </div> <div class="form-group"> <label for="custom_scope_query">Query</label> <input type="text" name="custom_scope_query" id="custom_scope_query" data-target="custom-scopes.customScopesQueryField" class="form-control" autocomplete="off" placeholder="(repo:mona/a OR repo:mona/b) AND lang:python" required maxlength="500"> </div> <p class="text-small color-fg-muted"> To see all available qualifiers, see our <a class="Link--inTextBlock" href="https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax">documentation</a>. </p> </form> </div> <div data-target="custom-scopes.manageCustomScopesForm"> <div data-target="custom-scopes.list"></div> </div> </div> </scrollable-region> <div data-view-component="true" class="Overlay-footer Overlay-footer--alignEnd Overlay-footer--divided"> <button data-action="click:custom-scopes#customScopesCancel" type="button" data-view-component="true" class="btn"> Cancel </button> <button form="custom-scopes-dialog-form" data-action="click:custom-scopes#customScopesSubmit" data-target="custom-scopes.customScopesSubmitButton" type="submit" data-view-component="true" class="btn-primary btn"> Create saved search </button> </div> </dialog></dialog-helper> </custom-scopes> </div> </qbsearch-input> <div class="position-relative HeaderMenu-link-wrap d-lg-inline-block"> <a href="/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fmesos%2Fblob%2Fmaster%2F3rdparty%2Flibprocess%2FREADME.md" class="HeaderMenu-link HeaderMenu-link--sign-in HeaderMenu-button flex-shrink-0 no-underline d-none d-lg-inline-flex border border-lg-0 rounded rounded-lg-0 px-2 py-1" style="margin-left: 12px;" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"site header menu","repository_id":null,"auth_type":"SIGN_UP","originating_url":"https://github.com/apache/mesos/blob/master/3rdparty/libprocess/README.md","user_id":null}}" data-hydro-click-hmac="c10a7397471a0a5933798f141c74af32b271be40b202c2819f6f2e5b99b0953c" data-analytics-event="{"category":"Marketing nav","action":"click to go to homepage","label":"ref_page:Marketing;ref_cta:Sign in;ref_loc:Header"}" > Sign in </a> </div> <a href="/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fblob%2Fshow&source=header-repo&source_repo=apache%2Fmesos" class="HeaderMenu-link HeaderMenu-link--sign-up HeaderMenu-button flex-shrink-0 d-flex d-lg-inline-flex no-underline border color-border-default rounded px-2 py-1" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"site header menu","repository_id":null,"auth_type":"SIGN_UP","originating_url":"https://github.com/apache/mesos/blob/master/3rdparty/libprocess/README.md","user_id":null}}" data-hydro-click-hmac="c10a7397471a0a5933798f141c74af32b271be40b202c2819f6f2e5b99b0953c" data-analytics-event="{"category":"Sign up","action":"click to sign up for account","label":"ref_page:/<user-name>/<repo-name>/blob/show;ref_cta:Sign up;ref_loc:header logged out"}" > Sign up </a> <button type="button" class="sr-only js-header-menu-focus-trap d-block d-lg-none">Reseting focus</button> </div> </div> </div> </div> </header> <div hidden="hidden" data-view-component="true" class="js-stale-session-flash stale-session-flash flash flash-warn flash-full"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span class="js-stale-session-flash-signed-in" hidden>You signed in with another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-signed-out" hidden>You signed out in another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-switched" hidden>You switched accounts on another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <button id="icon-button-a3cb7bc6-2a6b-490a-bbad-0362e51bd213" aria-labelledby="tooltip-011b57c5-cc04-4868-bc17-cdfb615a1b87" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium flash-close js-flash-close"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x Button-visual"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button><tool-tip id="tooltip-011b57c5-cc04-4868-bc17-cdfb615a1b87" for="icon-button-a3cb7bc6-2a6b-490a-bbad-0362e51bd213" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Dismiss alert</tool-tip> </div> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container" class="flash-container" data-turbo-replace> <template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div> </div> </div> </div> </template> </div> <div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled data-project-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" > <div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--page-header-bgColor, var(--color-page-header-bg));" data-turbo-replace> <div class="d-flex flex-nowrap flex-justify-end mb-3 px-3 px-lg-5" style="gap: 1rem;"> <div class="flex-auto min-width-0 width-fit"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> <span class="author flex-self-stretch" itemprop="author"> <a class="url fn" rel="author" data-hovercard-type="organization" data-hovercard-url="/orgs/apache/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/apache"> apache </a> </span> <span class="mx-1 flex-self-stretch color-fg-muted">/</span> <strong itemprop="name" class="mr-2 flex-self-stretch"> <a data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" href="/apache/mesos">mesos</a> </strong> <span></span><span class="Label Label--secondary v-align-middle mr-1">Public</span> </div> </div> <div id="repository-details-container" class="flex-shrink-0" data-turbo-replace style="max-width: 70%;"> <ul class="pagehead-actions flex-shrink-0 d-none d-md-inline" style="padding: 2px 0;"> <li> <a href="/login?return_to=%2Fapache%2Fmesos" rel="nofollow" id="repository-details-watch-button" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"notification subscription menu watch","repository_id":null,"auth_type":"LOG_IN","originating_url":"https://github.com/apache/mesos/blob/master/3rdparty/libprocess/README.md","user_id":null}}" data-hydro-click-hmac="d9969e3e6608e25c1a0e026d387e81eb1dedf13db652381c9056576314064dea" aria-label="You must be signed in to change notification settings" data-view-component="true" class="btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path> </svg>Notifications </a> <tool-tip id="tooltip-24c8c981-c702-43c8-8182-586c922be4e4" for="repository-details-watch-button" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">You must be signed in to change notification settings</tool-tip> </li> <li> <a icon="repo-forked" id="fork-button" href="/login?return_to=%2Fapache%2Fmesos" rel="nofollow" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"repo details fork button","repository_id":11469439,"auth_type":"LOG_IN","originating_url":"https://github.com/apache/mesos/blob/master/3rdparty/libprocess/README.md","user_id":null}}" data-hydro-click-hmac="dc1af0e6a7c885a466f4c292d3ae4f42b28e2b523ace9928506f9bde94dc08a4" data-view-component="true" class="btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> </svg>Fork <span id="repo-network-counter" data-pjax-replace="true" data-turbo-replace="true" title="1,676" data-view-component="true" class="Counter">1.7k</span> </a> </li> <li> <div data-view-component="true" class="BtnGroup d-flex"> <a href="/login?return_to=%2Fapache%2Fmesos" rel="nofollow" data-hydro-click="{"event_type":"authentication.click","payload":{"location_in_page":"star button","repository_id":11469439,"auth_type":"LOG_IN","originating_url":"https://github.com/apache/mesos/blob/master/3rdparty/libprocess/README.md","user_id":null}}" data-hydro-click-hmac="d3c7a72cf7f9bc820e6ea28fc9e38415c89754454f6c40bcd9380231246de0d3" aria-label="You must be signed in to star a repository" data-view-component="true" class="tooltipped tooltipped-sw btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg><span data-view-component="true" class="d-inline"> Star </span> <span id="repo-stars-counter-star" aria-label="5300 users starred this repository" data-singular-suffix="user starred this repository" data-plural-suffix="users starred this repository" data-turbo-replace="true" title="5,300" data-view-component="true" class="Counter js-social-count">5.3k</span> </a></div> </li> </ul> </div> </div> <div id="responsive-meta-container" data-turbo-replace> </div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <ul data-view-component="true" class="UnderlineNav-body list-style-none"> <li data-view-component="true" class="d-inline-flex"> <a id="code-tab" href="/apache/mesos" data-tab-item="i0code-tab" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches repo_packages repo_deployments repo_attestations /apache/mesos" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g c" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Code","target":"UNDERLINE_NAV.TAB"}" aria-current="page" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item selected"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> <span data-content="Code">Code</span> <span id="code-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="pull-requests-tab" href="/apache/mesos/pulls" data-tab-item="i1pull-requests-tab" data-selected-links="repo_pulls checks /apache/mesos/pulls" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g p" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Pull requests","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path> </svg> <span data-content="Pull requests">Pull requests</span> <span id="pull-requests-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="12" data-view-component="true" class="Counter">12</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="actions-tab" href="/apache/mesos/actions" data-tab-item="i2actions-tab" data-selected-links="repo_actions /apache/mesos/actions" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g a" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Actions","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> <span data-content="Actions">Actions</span> <span id="actions-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="projects-tab" href="/apache/mesos/projects" data-tab-item="i3projects-tab" data-selected-links="repo_projects new_repo_project repo_project /apache/mesos/projects" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g b" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Projects","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path> </svg> <span data-content="Projects">Projects</span> <span id="projects-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="0" hidden="hidden" data-view-component="true" class="Counter">0</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="security-tab" href="/apache/mesos/security" data-tab-item="i4security-tab" data-selected-links="security overview alerts policy token_scanning code_scanning /apache/mesos/security" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g s" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Security","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span data-content="Security">Security</span> <include-fragment src="/apache/mesos/security/overall-count" accept="text/fragment+html"></include-fragment> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="insights-tab" href="/apache/mesos/pulse" data-tab-item="i5insights-tab" data-selected-links="repo_graphs repo_contributors dependency_graph dependabot_updates pulse people community /apache/mesos/pulse" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-analytics-event="{"category":"Underline navbar","action":"Click tab","label":"Insights","target":"UNDERLINE_NAV.TAB"}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> <span data-content="Insights">Insights</span> <span id="insights-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> </ul> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <action-menu data-select-variant="none" data-view-component="true"> <focus-group direction="vertical" mnemonics retain> <button id="action-menu-27cd8561-1a49-40ed-8abf-a7c1eac29e0d-button" popovertarget="action-menu-27cd8561-1a49-40ed-8abf-a7c1eac29e0d-overlay" aria-controls="action-menu-27cd8561-1a49-40ed-8abf-a7c1eac29e0d-list" aria-haspopup="true" aria-labelledby="tooltip-fbfdd009-3075-4d61-af53-f6949c84b68c" type="button" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--medium UnderlineNav-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal Button-visual"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path> </svg> </button><tool-tip id="tooltip-fbfdd009-3075-4d61-af53-f6949c84b68c" for="action-menu-27cd8561-1a49-40ed-8abf-a7c1eac29e0d-button" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Additional navigation options</tool-tip> <anchored-position data-target="action-menu.overlay" id="action-menu-27cd8561-1a49-40ed-8abf-a7c1eac29e0d-overlay" anchor="action-menu-27cd8561-1a49-40ed-8abf-a7c1eac29e0d-button" align="start" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true"> <div data-view-component="true" class="Overlay Overlay--size-auto"> <div data-view-component="true" class="Overlay-body Overlay-body--paddingNone"> <action-list> <div data-view-component="true"> <ul aria-labelledby="action-menu-27cd8561-1a49-40ed-8abf-a7c1eac29e0d-button" id="action-menu-27cd8561-1a49-40ed-8abf-a7c1eac29e0d-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap"> <li hidden="hidden" data-menu-item="i0code-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-ddf6e36e-a58b-4b7c-ad42-8969496535b0" href="/apache/mesos" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Code </span> </a> </li> <li hidden="hidden" data-menu-item="i1pull-requests-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-a9216acf-5eb9-43e0-b421-d27f5c6c7c4b" href="/apache/mesos/pulls" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Pull requests </span> </a> </li> <li hidden="hidden" data-menu-item="i2actions-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-07b818b7-d72b-4596-a4fe-ad8383e33b3a" href="/apache/mesos/actions" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Actions </span> </a> </li> <li hidden="hidden" data-menu-item="i3projects-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-c22c66fb-9338-474f-8fcc-e905c537476f" href="/apache/mesos/projects" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Projects </span> </a> </li> <li hidden="hidden" data-menu-item="i4security-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-fb816f7e-f5cd-4b61-9f74-27119e1f472a" href="/apache/mesos/security" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Security </span> </a> </li> <li hidden="hidden" data-menu-item="i5insights-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-6875feee-7524-49e1-b0d6-93bd9a691eff" href="/apache/mesos/pulse" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Insights </span> </a> </li> </ul> </div></action-list> </div> </div></anchored-position> </focus-group> </action-menu></div> </nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <react-app app-name="react-code-view" initial-path="/apache/mesos/blob/master/3rdparty/libprocess/README.md" style="display: block; min-height: calc(100vh - 64px);" data-attempted-ssr="true" data-ssr="true" data-lazy="false" data-alternate="false" data-data-router-enabled="false" > <script type="application/json" data-target="react-app.embeddedData">{"payload":{"allShortcutsEnabled":false,"fileTree":{"3rdparty/libprocess":{"items":[{"name":"3rdparty","path":"3rdparty/libprocess/3rdparty","contentType":"directory"},{"name":"examples","path":"3rdparty/libprocess/examples","contentType":"directory"},{"name":"include","path":"3rdparty/libprocess/include","contentType":"directory"},{"name":"m4","path":"3rdparty/libprocess/m4","contentType":"directory"},{"name":"src","path":"3rdparty/libprocess/src","contentType":"directory"},{"name":"CMakeLists.txt","path":"3rdparty/libprocess/CMakeLists.txt","contentType":"file"},{"name":"LICENSE","path":"3rdparty/libprocess/LICENSE","contentType":"file"},{"name":"Makefile.am","path":"3rdparty/libprocess/Makefile.am","contentType":"file"},{"name":"README.md","path":"3rdparty/libprocess/README.md","contentType":"file"},{"name":"TODO","path":"3rdparty/libprocess/TODO","contentType":"file"},{"name":"bootstrap","path":"3rdparty/libprocess/bootstrap","contentType":"file"},{"name":"configure.ac","path":"3rdparty/libprocess/configure.ac","contentType":"file"}],"totalCount":12},"3rdparty":{"items":[{"name":"cmake","path":"3rdparty/cmake","contentType":"directory"},{"name":"http-parser","path":"3rdparty/http-parser","contentType":"directory"},{"name":"libprocess","path":"3rdparty/libprocess","contentType":"directory"},{"name":"stout","path":"3rdparty/stout","contentType":"directory"},{"name":"CMakeLists.txt","path":"3rdparty/CMakeLists.txt","contentType":"file"},{"name":"Makefile.am","path":"3rdparty/Makefile.am","contentType":"file"},{"name":"README.md","path":"3rdparty/README.md","contentType":"file"},{"name":"boost-1.81.0.tar.gz","path":"3rdparty/boost-1.81.0.tar.gz","contentType":"file"},{"name":"boost.md","path":"3rdparty/boost.md","contentType":"file"},{"name":"bzip2-1.0.6.patch","path":"3rdparty/bzip2-1.0.6.patch","contentType":"file"},{"name":"bzip2-1.0.6.tar.gz","path":"3rdparty/bzip2-1.0.6.tar.gz","contentType":"file"},{"name":"concurrentqueue-7b69a8f.tar.gz","path":"3rdparty/concurrentqueue-7b69a8f.tar.gz","contentType":"file"},{"name":"concurrentqueue.md","path":"3rdparty/concurrentqueue.md","contentType":"file"},{"name":"csi-0.2.0.tar.gz","path":"3rdparty/csi-0.2.0.tar.gz","contentType":"file"},{"name":"csi-1.1.0.tar.gz","path":"3rdparty/csi-1.1.0.tar.gz","contentType":"file"},{"name":"cyrus-sasl-2.1.27rc3.patch","path":"3rdparty/cyrus-sasl-2.1.27rc3.patch","contentType":"file"},{"name":"elfio-3.2.tar.gz","path":"3rdparty/elfio-3.2.tar.gz","contentType":"file"},{"name":"glog-0.4.0.patch","path":"3rdparty/glog-0.4.0.patch","contentType":"file"},{"name":"glog-0.4.0.tar.gz","path":"3rdparty/glog-0.4.0.tar.gz","contentType":"file"},{"name":"gmock_sources.cc.in","path":"3rdparty/gmock_sources.cc.in","contentType":"file"},{"name":"googletest-release-1.8.0.patch","path":"3rdparty/googletest-release-1.8.0.patch","contentType":"file"},{"name":"googletest-release-1.8.0.tar.gz","path":"3rdparty/googletest-release-1.8.0.tar.gz","contentType":"file"},{"name":"gperftools-2.5.tar.gz","path":"3rdparty/gperftools-2.5.tar.gz","contentType":"file"},{"name":"grpc-1.11.1.patch","path":"3rdparty/grpc-1.11.1.patch","contentType":"file"},{"name":"grpc-1.11.1.tar.gz","path":"3rdparty/grpc-1.11.1.tar.gz","contentType":"file"},{"name":"grpc.md","path":"3rdparty/grpc.md","contentType":"file"},{"name":"http-parser-2.6.2.tar.gz","path":"3rdparty/http-parser-2.6.2.tar.gz","contentType":"file"},{"name":"jemalloc-5.0.1.tar.gz","path":"3rdparty/jemalloc-5.0.1.tar.gz","contentType":"file"},{"name":"leveldb-1.19.patch","path":"3rdparty/leveldb-1.19.patch","contentType":"file"},{"name":"leveldb-1.19.tar.gz","path":"3rdparty/leveldb-1.19.tar.gz","contentType":"file"},{"name":"libarchive-3.3.2.patch","path":"3rdparty/libarchive-3.3.2.patch","contentType":"file"},{"name":"libarchive-3.3.2.tar.gz","path":"3rdparty/libarchive-3.3.2.tar.gz","contentType":"file"},{"name":"libev-4.22.tar.gz","path":"3rdparty/libev-4.22.tar.gz","contentType":"file"},{"name":"libevent-2.0.22-stable.patch","path":"3rdparty/libevent-2.0.22-stable.patch","contentType":"file"},{"name":"libevent-2.0.22-stable.tar.gz","path":"3rdparty/libevent-2.0.22-stable.tar.gz","contentType":"file"},{"name":"libseccomp-2.3.3.tar.gz","path":"3rdparty/libseccomp-2.3.3.tar.gz","contentType":"file"},{"name":"nvml-352.79.tar.gz","path":"3rdparty/nvml-352.79.tar.gz","contentType":"file"},{"name":"patch.exe.manifest","path":"3rdparty/patch.exe.manifest","contentType":"file"},{"name":"picojson-1.3.0.patch","path":"3rdparty/picojson-1.3.0.patch","contentType":"file"},{"name":"picojson-1.3.0.tar.gz","path":"3rdparty/picojson-1.3.0.tar.gz","contentType":"file"},{"name":"pip-7.1.2.tar.gz","path":"3rdparty/pip-7.1.2.tar.gz","contentType":"file"},{"name":"protobuf-3.5.0.patch","path":"3rdparty/protobuf-3.5.0.patch","contentType":"file"},{"name":"protobuf-3.5.0.tar.gz","path":"3rdparty/protobuf-3.5.0.tar.gz","contentType":"file"},{"name":"protobuf-3.5.0_s390x.patch","path":"3rdparty/protobuf-3.5.0_s390x.patch","contentType":"file"},{"name":"protobuf.md","path":"3rdparty/protobuf.md","contentType":"file"},{"name":"rapidjson-1.1.0.patch","path":"3rdparty/rapidjson-1.1.0.patch","contentType":"file"},{"name":"rapidjson-1.1.0.tar.gz","path":"3rdparty/rapidjson-1.1.0.tar.gz","contentType":"file"},{"name":"rapidjson.md","path":"3rdparty/rapidjson.md","contentType":"file"},{"name":"re2-2020-07-06.tar.gz","path":"3rdparty/re2-2020-07-06.tar.gz","contentType":"file"},{"name":"setuptools-20.9.0.tar.gz","path":"3rdparty/setuptools-20.9.0.tar.gz","contentType":"file"},{"name":"versions.am","path":"3rdparty/versions.am","contentType":"file"},{"name":"wheel-0.24.0.tar.gz","path":"3rdparty/wheel-0.24.0.tar.gz","contentType":"file"},{"name":"xz-5.2.3-modified.tar.gz","path":"3rdparty/xz-5.2.3-modified.tar.gz","contentType":"file"},{"name":"xz-5.2.3.patch","path":"3rdparty/xz-5.2.3.patch","contentType":"file"},{"name":"xz.README.txt","path":"3rdparty/xz.README.txt","contentType":"file"},{"name":"zookeeper-3.4.8.patch","path":"3rdparty/zookeeper-3.4.8.patch","contentType":"file"},{"name":"zookeeper-3.4.8.tar.gz","path":"3rdparty/zookeeper-3.4.8.tar.gz","contentType":"file"}],"totalCount":57},"":{"items":[{"name":"3rdparty","path":"3rdparty","contentType":"directory"},{"name":"bin","path":"bin","contentType":"directory"},{"name":"cmake","path":"cmake","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"include","path":"include","contentType":"directory"},{"name":"m4","path":"m4","contentType":"directory"},{"name":"site","path":"site","contentType":"directory"},{"name":"src","path":"src","contentType":"directory"},{"name":"support","path":"support","contentType":"directory"},{"name":".asf.yaml","path":".asf.yaml","contentType":"file"},{"name":".gitattributes","path":".gitattributes","contentType":"file"},{"name":"CHANGELOG","path":"CHANGELOG","contentType":"file"},{"name":"CMakeLists.txt","path":"CMakeLists.txt","contentType":"file"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","contentType":"symlink_file"},{"name":"Doxyfile","path":"Doxyfile","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"Makefile.am","path":"Makefile.am","contentType":"file"},{"name":"NOTICE","path":"NOTICE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"bootstrap","path":"bootstrap","contentType":"file"},{"name":"configure.ac","path":"configure.ac","contentType":"file"},{"name":"mesos.pc.in","path":"mesos.pc.in","contentType":"file"}],"totalCount":22}},"fileTreeProcessingTime":53.112097,"foldersToFetch":[],"repo":{"id":11469439,"defaultBranch":"master","name":"mesos","ownerLogin":"apache","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2013-07-17T07:00:13.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/47359?v=4","public":true,"private":false,"isOrgOwned":true},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1717027285.0","canEdit":false,"refType":"branch","currentOid":"c1b42f79d157aa900be5cbb0c1023f1479962aa7"},"path":"3rdparty/libprocess/README.md","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/apache/mesos/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"README.md","displayUrl":"https://github.com/apache/mesos/blob/master/3rdparty/libprocess/README.md?raw=true","headerInfo":{"blobSize":"29.6 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"912991f","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fmesos%2Fblob%2Fmaster%2F3rdparty%2Flibprocess%2FREADME.md","isCSV":false,"isRichtext":true,"toc":[{"level":1,"text":"Libprocess User Guide","anchor":"libprocess-user-guide","htmlText":"Libprocess User Guide"},{"level":2,"text":"Table of Contents","anchor":"table-of-contents","htmlText":"Table of Contents"},{"level":2,"text":" Presentations","anchor":"-presentations","htmlText":" Presentations"},{"level":2,"text":" Overview","anchor":"-overview","htmlText":" Overview"},{"level":2,"text":" Futures and Promises","anchor":"-futures-and-promises","htmlText":" Futures and Promises"},{"level":3,"text":" Basics","anchor":"-basics","htmlText":" Basics"},{"level":3,"text":" States","anchor":"-states","htmlText":" States"},{"level":3,"text":" Discarding a Future (aka Cancellation)","anchor":"-discarding-a-future-aka-cancellation","htmlText":" Discarding a Future (aka Cancellation)"},{"level":3,"text":" Abandoned Futures","anchor":"-abandoned-futures","htmlText":" Abandoned Futures"},{"level":3,"text":" Composition: Future::then(), Future::repair(), and Future::recover()","anchor":"-composition-futurethen-futurerepair-and-futurerecover","htmlText":" Composition: Future::then(), Future::repair(), and Future::recover()"},{"level":3,"text":" Discarding and Composition","anchor":"-discarding-and-composition","htmlText":" Discarding and Composition"},{"level":4,"text":" 1. Future::then() enforces discards","anchor":"-1-futurethen-enforces-discards","htmlText":" 1. Future::then() enforces discards"},{"level":4,"text":" 2. Sometimes you want something to be undiscardable()","anchor":"-2-sometimes-you-want-something-to-be-undiscardable","htmlText":" 2. Sometimes you want something to be undiscardable()"},{"level":3,"text":" Callback Semantics","anchor":"-callback-semantics","htmlText":" Callback Semantics"},{"level":3,"text":"CHECK() Overloads","anchor":"-check-overloads","htmlText":"CHECK() Overloads"},{"level":2,"text":" HTTP","anchor":"-http","htmlText":" HTTP"},{"level":3,"text":"route","anchor":"route","htmlText":"route"},{"level":3,"text":"get","anchor":"get","htmlText":"get"},{"level":3,"text":"post and requestDelete","anchor":"post-and-requestdelete","htmlText":"post and requestDelete"},{"level":3,"text":"Connection","anchor":"connection","htmlText":"Connection"},{"level":2,"text":" Processes (aka Actors)","anchor":"-processes-aka-actors","htmlText":" Processes (aka Actors)"},{"level":3,"text":"Process Lifecycle","anchor":"process-lifecycle","htmlText":"Process Lifecycle"},{"level":4,"text":"Memory Management","anchor":"memory-management","htmlText":"Memory Management"},{"level":3,"text":"Process Identity: PID and UPID","anchor":"process-identity-pid-and-upid","htmlText":"Process Identity: PID and UPID"},{"level":3,"text":"Process Event Queue (aka Mailbox)","anchor":"process-event-queue-aka-mailbox","htmlText":"Process Event Queue (aka Mailbox)"},{"level":4,"text":"MessageEvent","anchor":"messageevent","htmlText":"MessageEvent"},{"level":4,"text":"DispatchEvent","anchor":"dispatchevent","htmlText":"DispatchEvent"},{"level":4,"text":"HttpEvent","anchor":"httpevent","htmlText":"HttpEvent"},{"level":4,"text":"ExitedEvent","anchor":"exitedevent","htmlText":"ExitedEvent"},{"level":4,"text":"TerminateEvent","anchor":"terminateevent","htmlText":"TerminateEvent"},{"level":3,"text":" Processes and the Asynchronous Pimpl Pattern","anchor":"-processes-and-the-asynchronous-pimpl-pattern","htmlText":" Processes and the Asynchronous Pimpl Pattern"},{"level":2,"text":" Clock Management and Timeouts","anchor":"-clock-management-and-timeouts","htmlText":" Clock Management and Timeouts"},{"level":2,"text":" Miscellaneous Primitives","anchor":"-miscellaneous-primitives","htmlText":" Miscellaneous Primitives"},{"level":3,"text":"async","anchor":"async","htmlText":"async"},{"level":2,"text":" Optimized Run Queue and Event Queue","anchor":"-optimized-run-queue-and-event-queue","htmlText":" Optimized Run Queue and Event Queue"},{"level":4,"text":"Details","anchor":"details","htmlText":"Details"},{"level":4,"text":"Benchmark","anchor":"benchmark","htmlText":"Benchmark"}],"lineInfo":{"truncatedLoc":"837","truncatedSloc":"580"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Markdown","languageID":222,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/apache/mesos/blob/master/3rdparty/libprocess/README.md","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/apache/mesos/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/apache/mesos/raw/refs/heads/master/3rdparty/libprocess/README.md","renderImageOrRaw":false,"richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLibprocess User Guide\u003c/h1\u003e\u003ca id=\"user-content-libprocess-user-guide\" class=\"anchor\" aria-label=\"Permalink: Libprocess User Guide\" href=\"#libprocess-user-guide\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003elibprocess provides general primitives and abstractions for asynchronous programming with \u003ca href=\"https://en.wikipedia.org/wiki/Futures_and_promises\" rel=\"nofollow\"\u003efutures/promises\u003c/a\u003e, \u003ca href=\"https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol\" rel=\"nofollow\"\u003eHTTP\u003c/a\u003e, and \u003ca href=\"http://en.wikipedia.org/wiki/Actor_model\" rel=\"nofollow\"\u003eactors\u003c/a\u003e.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003e\u003cbr\u003e \u003cstrong\u003eInspired by \u003ca href=\"http://erlang.org\" rel=\"nofollow\"\u003eErlang\u003c/a\u003e, libprocess gets it's name from calling an \"actor\" a \"process\" (not to be confused by an operating system process).\u003c/strong\u003e \u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTable of Contents\u003c/h2\u003e\u003ca id=\"user-content-table-of-contents\" class=\"anchor\" aria-label=\"Permalink: Table of Contents\" href=\"#table-of-contents\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#presentations\"\u003ePresentations\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#overview\"\u003eOverview\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#futures-and-promises\"\u003eFutures and Promises\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#http\"\u003eHTTP\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#processes\"\u003eProcesses (aka Actors)\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#clock\"\u003eClock Management and Timeouts\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#miscellaneous-primitives\"\u003eMiscellaneous Primitives\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#optimized-run-queue-event-queue\"\u003eOptimized Run Queue and Event Queue\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003chr\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-presentations\"\u003e\u003c/a\u003e Presentations\u003c/h2\u003e\u003ca id=\"user-content--presentations\" class=\"anchor\" aria-label=\"Permalink: Presentations\" href=\"#-presentations\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe following talks are recommended to get an overview of libprocess:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"https://www.youtube.com/watch?v=KjqaZYP0T2U\" rel=\"nofollow\"\u003elibprocess, a concurrent and asynchronous programming library (San Francisco C++ Meetup)\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-overview\"\u003e\u003c/a\u003e Overview\u003c/h2\u003e\u003ca id=\"user-content--overview\" class=\"anchor\" aria-label=\"Permalink: Overview\" href=\"#-overview\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis user guide is meant to help understand the constructs within the libprocess library. The main constructs are:\u003c/p\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#futures-and-promises\"\u003eFutures and Promises\u003c/a\u003e which are used to build ...\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#http\"\u003eHTTP\u003c/a\u003e abstractions, which make the foundation for ...\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#processes\"\u003eProcesses (aka Actors)\u003c/a\u003e.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp dir=\"auto\"\u003eFor most people processes (aka actors) are the most foreign of the concepts, but they are arguably the most critical part of the library (they library is named after them!). Nevertheless, we organized this guide to walk through futures/promises and HTTP before processes because the former two are prerequisites for the latter.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-futures-and-promises\"\u003e\u003c/a\u003e Futures and Promises\u003c/h2\u003e\u003ca id=\"user-content--futures-and-promises\" class=\"anchor\" aria-label=\"Permalink: Futures and Promises\" href=\"#-futures-and-promises\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eFuture\u003c/code\u003e and \u003ccode\u003ePromise\u003c/code\u003e primitives are used to enable programmers to write asynchronous, non-blocking, and highly concurrent software.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eA \u003ccode\u003eFuture\u003c/code\u003e acts as the read-side of a result which might be computed asynchronously. A \u003ccode\u003ePromise\u003c/code\u003e, on the other hand, acts as the write-side \"container\".\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eLooking for a specific topic?\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#futures-and-promises-basics\"\u003eBasics\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#futures-and-promises-states\"\u003eStates\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#futures-and-promises-discarding-a-future\"\u003eDisarding a Future (aka Cancellation)\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#futures-and-promises-abandoned-futures\"\u003eAbandoned Futures\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#futures-and-promises-composition\"\u003eComposition: \u003ccode\u003eFuture::then()\u003c/code\u003e, \u003ccode\u003eFuture::repair()\u003c/code\u003e, and \u003ccode\u003eFuture::recover()\u003c/code\u003e\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#futures-and-promises-discarding-and-composition\"\u003eDiscarding and Composition\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#futures-and-promises-callback-semantics\"\u003eCallback Semantics\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#futures-and-promises-check-overloads\"\u003e\u003ccode\u003eCHECK()\u003c/code\u003e Overloads\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-futures-and-promises-basics\"\u003e\u003c/a\u003e Basics\u003c/h3\u003e\u003ca id=\"user-content--basics\" class=\"anchor\" aria-label=\"Permalink: Basics\" href=\"#-basics\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA \u003ccode\u003ePromise\u003c/code\u003e is templated by the type that it will \"contain\". A \u003ccode\u003ePromise\u003c/code\u003e is not copyable or assignable in order to encourage strict ownership rules between processes (i.e., it's hard to reason about multiple actors concurrently trying to complete a \u003ccode\u003ePromise\u003c/code\u003e, even if it's safe to do so concurrently).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eYou can get a \u003ccode\u003eFuture\u003c/code\u003e from a \u003ccode\u003ePromise\u003c/code\u003e using \u003ccode\u003ePromise::future()\u003c/code\u003e. Unlike \u003ccode\u003ePromise\u003c/code\u003e, a \u003ccode\u003eFuture\u003c/code\u003e can be both copied and assigned.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003e\u003cbr\u003e As of this time, the templated type of the future must be the exact same as the promise: you cannot create a covariant or contravariant future. \u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp dir=\"auto\"\u003eHere is a simple example of using \u003ccode\u003ePromise\u003c/code\u003e and \u003ccode\u003eFuture\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::Future;\nusing process::Promise;\n\nint main(int argc, char** argv)\n{\n Promise\u0026lt;int\u0026gt; promise;\n\n Future\u0026lt;int\u0026gt; future = promise.future();\n\n // You can copy a future.\n Future\u0026lt;int\u0026gt; future2 = future;\n\n // You can also assign a future (NOTE: this future will never\n // complete because the Promise goes out of scope, but the\n // Future is still valid and can be used normally.)\n future = Promise\u0026lt;int\u0026gt;().future();\n\n return 0;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Future;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Promise;\n\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emain\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e argc, \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e** argv)\n{\n Promise\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt; promise;\n\n Future\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt; future = promise.\u003cspan class=\"pl-c1\"\u003efuture\u003c/span\u003e();\n\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e You can copy a future.\u003c/span\u003e\n Future\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt; future2 = future;\n\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e You can also assign a future (NOTE: this future will never\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e complete because the Promise goes out of scope, but the\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Future is still valid and can be used normally.)\u003c/span\u003e\n future = Promise\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt;().\u003cspan class=\"pl-c1\"\u003efuture\u003c/span\u003e();\n\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e;\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-futures-and-promises-states\"\u003e\u003c/a\u003e States\u003c/h3\u003e\u003ca id=\"user-content--states\" class=\"anchor\" aria-label=\"Permalink: States\" href=\"#-states\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA promise starts in the \u003ccode\u003ePENDING\u003c/code\u003e state and can then transition to any of the \u003ccode\u003eREADY\u003c/code\u003e, \u003ccode\u003eFAILED\u003c/code\u003e, or \u003ccode\u003eDISCARDED\u003c/code\u003e states. You can check the state using \u003ccode\u003eFuture::isPending()\u003c/code\u003e, \u003ccode\u003eFuture::isReady()\u003c/code\u003e, \u003ccode\u003eFuture::isFailed()\u003c/code\u003e, and \u003ccode\u003eFuture::isDiscarded()\u003c/code\u003e.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003e\u003cbr\u003e We typically refer to transitioning to \u003ccode\u003eREADY\u003c/code\u003e as \u003cem\u003ecompleting the promise/future\u003c/em\u003e. \u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp dir=\"auto\"\u003eYou can also add a callback to be invoked when (or if) a transition occurs (or has occcured) by using the \u003ccode\u003eFuture::onReady()\u003c/code\u003e, \u003ccode\u003eFuture::onFailed()\u003c/code\u003e, and \u003ccode\u003eFuture::onDiscarded()\u003c/code\u003e. As a \u003cem\u003ecatch all\u003c/em\u003e you can use \u003ccode\u003eFuture::onAny()\u003c/code\u003e which will invoke it's callbacks on a transition to all of \u003ccode\u003eREADY\u003c/code\u003e, \u003ccode\u003eFAILED\u003c/code\u003e, and \u003ccode\u003eDISCARDED\u003c/code\u003e. \u003cstrong\u003eSee \u003ca href=\"#futures-and-promises-callback-semantics\"\u003eCallback Semantics\u003c/a\u003e for a discussion of how/when these callbacks get invoked.\u003c/strong\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe following table is meant to capture these transitions:\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eTransition\u003c/th\u003e\n\u003cth\u003e\u003ccode\u003ePromise::*()\u003c/code\u003e\u003c/th\u003e\n\u003cth\u003e\u003ccode\u003eFuture::is*()\u003c/code\u003e\u003c/th\u003e\n\u003cth\u003e\u003ccode\u003eFuture::on*()\u003c/code\u003e\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eREADY\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003ePromise::set(T)\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003eFuture::isReady()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003eFuture::onReady(F\u0026amp;\u0026amp;)\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eFAILED\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003ePromise::fail(const std::string\u0026amp;)\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003eFuture::isFailed()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003eFuture::onFailed(F\u0026amp;\u0026amp;)\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eDISCARDED\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003ePromise::discard()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003eFuture::isDiscarded()\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003eFuture::onDiscarded(F\u0026amp;\u0026amp;)\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003e\u003cbr\u003e Code Style: prefer \u003ca href=\"#futures-and-promises-composition\"\u003ecomposition\u003c/a\u003e using \u003ccode\u003eFuture::then()\u003c/code\u003e and \u003ccode\u003eFuture::recover()\u003c/code\u003e over \u003ccode\u003eFuture::onReady()\u003c/code\u003e, \u003ccode\u003eFuture::onFailed()\u003c/code\u003e, \u003ccode\u003eFuture::onDiscarded()\u003c/code\u003e, and \u003ccode\u003eFuture::onAny()\u003c/code\u003e. A good rule of thumb is if you find yourself creating your own instance of a \u003ccode\u003ePromise\u003c/code\u003e to compose an asynchronous operation you should use \u003ca href=\"#futures-and-promises-composition\"\u003ecomposition\u003c/a\u003e instead! \u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp dir=\"auto\"\u003eWe use the macros \u003ccode\u003eCHECK_PENDING()\u003c/code\u003e, \u003ccode\u003eCHECK_READY()\u003c/code\u003e, \u003ccode\u003eCHECK_FAILED()\u003c/code\u003e, \u003ccode\u003eCHECK_DISCARDED()\u003c/code\u003e throughout our examples. See \u003ca href=\"#futures-and-promises-check-overloads\"\u003e\u003ccode\u003eCHECK()\u003c/code\u003e Overloads\u003c/a\u003e for more details about these macros.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-futures-and-promises-discarding-a-future\"\u003e\u003c/a\u003e Discarding a Future (aka Cancellation)\u003c/h3\u003e\u003ca id=\"user-content--discarding-a-future-aka-cancellation\" class=\"anchor\" aria-label=\"Permalink: Discarding a Future (aka Cancellation)\" href=\"#-discarding-a-future-aka-cancellation\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou can \"cancel\" the result of some asynchronous operation by discarding a future. Unlike doing a discard on a promise, \u003cem\u003ediscarding a future is a request that may or may not be be satisfiable\u003c/em\u003e. You discard a future using \u003ccode\u003eFuture::discard()\u003c/code\u003e. You can determine if a future has a discard request by using \u003ccode\u003eFuture::hasDiscard()\u003c/code\u003e or set up a callback using \u003ccode\u003eFuture::onDiscard()\u003c/code\u003e. Here's an example:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::Future;\nusing process::Promise;\n\nint main(int argc, char** argv)\n{\n Promise\u0026lt;int\u0026gt; promise;\n\n Future\u0026lt;int\u0026gt; future = promise.future();\n\n CHECK_PENDING(future);\n\n future.discard();\n\n CHECK(promise.future().hasDiscard());\n\n CHECK_PENDING(future); // THE FUTURE IS STILL PENDING!\n\n return 0;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Future;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Promise;\n\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emain\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e argc, \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e** argv)\n{\n Promise\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt; promise;\n\n Future\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt; future = promise.\u003cspan class=\"pl-c1\"\u003efuture\u003c/span\u003e();\n\n \u003cspan class=\"pl-c1\"\u003eCHECK_PENDING\u003c/span\u003e(future);\n\n future.\u003cspan class=\"pl-c1\"\u003ediscard\u003c/span\u003e();\n\n \u003cspan class=\"pl-c1\"\u003eCHECK\u003c/span\u003e(promise.\u003cspan class=\"pl-c1\"\u003efuture\u003c/span\u003e().\u003cspan class=\"pl-c1\"\u003ehasDiscard\u003c/span\u003e());\n\n \u003cspan class=\"pl-c1\"\u003eCHECK_PENDING\u003c/span\u003e(future); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e THE FUTURE IS STILL PENDING!\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e;\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe provider of the future will often use \u003ccode\u003eFuture::onDiscard()\u003c/code\u003e to watch for discard requests and try and act accordingly, for example:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::Future;\nusing process::Promise;\n\nint main(int argc, char** argv)\n{\n Promise\u0026lt;int\u0026gt; promise;\n\n // Set up a callback to discard the future if\n // requested (this is not always possible!).\n promise.future().onDiscard([\u0026amp;]() {\n promise.discard();\n });\n\n Future\u0026lt;int\u0026gt; future = promise.future();\n\n CHECK_PENDING(future);\n\n future.discard();\n\n CHECK_DISCARDED(future); // NO LONGER PENDING!\n\n return 0;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Future;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Promise;\n\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emain\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e argc, \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e** argv)\n{\n Promise\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt; promise;\n\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Set up a callback to discard the future if\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e requested (this is not always possible!).\u003c/span\u003e\n promise.\u003cspan class=\"pl-c1\"\u003efuture\u003c/span\u003e().\u003cspan class=\"pl-c1\"\u003eonDiscard\u003c/span\u003e([\u0026amp;]() {\n promise.\u003cspan class=\"pl-c1\"\u003ediscard\u003c/span\u003e();\n });\n\n Future\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt; future = promise.\u003cspan class=\"pl-c1\"\u003efuture\u003c/span\u003e();\n\n \u003cspan class=\"pl-c1\"\u003eCHECK_PENDING\u003c/span\u003e(future);\n\n future.\u003cspan class=\"pl-c1\"\u003ediscard\u003c/span\u003e();\n\n \u003cspan class=\"pl-c1\"\u003eCHECK_DISCARDED\u003c/span\u003e(future); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e NO LONGER PENDING!\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e;\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-futures-and-promises-abandoned-futures\"\u003e\u003c/a\u003e Abandoned Futures\u003c/h3\u003e\u003ca id=\"user-content--abandoned-futures\" class=\"anchor\" aria-label=\"Permalink: Abandoned Futures\" href=\"#-abandoned-futures\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAn instance of \u003ccode\u003ePromise\u003c/code\u003e that is deleted before it has transitioned out of \u003ccode\u003ePENDING\u003c/code\u003e is considered abandoned. The concept of abandonment was added late to the library so for backwards compatibility reasons we could not add a new state but instead needed to have it be a sub-state of \u003ccode\u003ePENDING\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eYou can check if a future has been abandoned by doing \u003ccode\u003eFuture::isAbandoned()\u003c/code\u003e and set up a callback using \u003ccode\u003eFuture::onAbandoned()\u003c/code\u003e. Here's an example:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::Future;\nusing process::Promise;\n\nint main(int argc, char** argv)\n{\n Promise\u0026lt;int\u0026gt;* promise = new Promise\u0026lt;int\u0026gt;();\n\n Future\u0026lt;int\u0026gt; future = promise-\u0026gt;future();\n\n CHECK(!future.isAbandoned());\n\n delete promise; // ABANDONMENT!\n\n CHECK_ABANDONED(future);\n\n CHECK_PENDING(future); // ALSO STILL PENDING!\n\n return 0;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Future;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Promise;\n\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emain\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e argc, \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e** argv)\n{\n Promise\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt;* promise = \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e Promise\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt;();\n\n Future\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt; future = promise-\u0026gt;\u003cspan class=\"pl-c1\"\u003efuture\u003c/span\u003e();\n\n \u003cspan class=\"pl-c1\"\u003eCHECK\u003c/span\u003e(!future.\u003cspan class=\"pl-c1\"\u003eisAbandoned\u003c/span\u003e());\n\n \u003cspan class=\"pl-k\"\u003edelete\u003c/span\u003e promise; \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e ABANDONMENT!\u003c/span\u003e\n\n \u003cspan class=\"pl-c1\"\u003eCHECK_ABANDONED\u003c/span\u003e(future);\n\n \u003cspan class=\"pl-c1\"\u003eCHECK_PENDING\u003c/span\u003e(future); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e ALSO STILL PENDING!\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e;\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-futures-and-promises-composition\"\u003e\u003c/a\u003e Composition: \u003ccode\u003eFuture::then()\u003c/code\u003e, \u003ccode\u003eFuture::repair()\u003c/code\u003e, and \u003ccode\u003eFuture::recover()\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content--composition-futurethen-futurerepair-and-futurerecover\" class=\"anchor\" aria-label=\"Permalink: Composition: Future::then(), Future::repair(), and Future::recover()\" href=\"#-composition-futurethen-futurerepair-and-futurerecover\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou can compose together asynchronous function calls using \u003ccode\u003eFuture::then()\u003c/code\u003e, \u003ccode\u003eFuture::repair()\u003c/code\u003e, and \u003ccode\u003eFuture::recover()\u003c/code\u003e. To help understand the value of composition, we'll start with an example of how you might manually do this composition:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::Future;\nusing process::Promise;\n\n// Returns an instance of `Person` for the specified `name`.\nFuture\u0026lt;Person\u0026gt; find(const std::string\u0026amp; name);\n\n// Returns the mother (an instance of `Person`) of the specified `name`.\nFuture\u0026lt;Person\u0026gt; mother(const std::string\u0026amp; name)\n{\n // First find the person.\n Future\u0026lt;Person\u0026gt; person = find(name);\n\n // Now create a `Promise` that we can use to compose the two asynchronous calls.\n Promise\u0026lt;Person\u0026gt;* promise = new Promise\u0026lt;Person\u0026gt;();\n\n Future\u0026lt;Person\u0026gt; mother = promise-\u0026gt;future();\n\n // Here is the boiler plate that can be replaced by `Future::then()`!\n person.onAny([](const Future\u0026lt;Person\u0026gt;\u0026amp; person) {\n if (person.isFailed()) {\n promise-\u0026gt;fail(person.failure());\n } else if (person.isDiscarded()) {\n promise-\u0026gt;discard();\n } else {\n CHECK_READY(person);\n promise-\u0026gt;set(find(person-\u0026gt;mother));\n }\n delete promise;\n });\n\n return mother;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Future;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Promise;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Returns an instance of `Person` for the specified `name`.\u003c/span\u003e\nFuture\u0026lt;Person\u0026gt; \u003cspan class=\"pl-en\"\u003efind\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e std::string\u0026amp; name);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Returns the mother (an instance of `Person`) of the specified `name`.\u003c/span\u003e\nFuture\u0026lt;Person\u0026gt; \u003cspan class=\"pl-en\"\u003emother\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e std::string\u0026amp; name)\n{\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e First find the person.\u003c/span\u003e\n Future\u0026lt;Person\u0026gt; person = \u003cspan class=\"pl-c1\"\u003efind\u003c/span\u003e(name);\n\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Now create a `Promise` that we can use to compose the two asynchronous calls.\u003c/span\u003e\n Promise\u0026lt;Person\u0026gt;* promise = \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e Promise\u0026lt;Person\u0026gt;();\n\n Future\u0026lt;Person\u0026gt; mother = promise-\u0026gt;\u003cspan class=\"pl-c1\"\u003efuture\u003c/span\u003e();\n\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Here is the boiler plate that can be replaced by `Future::then()`!\u003c/span\u003e\n person.\u003cspan class=\"pl-c1\"\u003eonAny\u003c/span\u003e([](\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e Future\u0026lt;Person\u0026gt;\u0026amp; person) {\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (person.\u003cspan class=\"pl-c1\"\u003eisFailed\u003c/span\u003e()) {\n promise-\u0026gt;\u003cspan class=\"pl-c1\"\u003efail\u003c/span\u003e(person.\u003cspan class=\"pl-c1\"\u003efailure\u003c/span\u003e());\n } \u003cspan class=\"pl-k\"\u003eelse\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (person.\u003cspan class=\"pl-c1\"\u003eisDiscarded\u003c/span\u003e()) {\n promise-\u0026gt;\u003cspan class=\"pl-c1\"\u003ediscard\u003c/span\u003e();\n } \u003cspan class=\"pl-k\"\u003eelse\u003c/span\u003e {\n \u003cspan class=\"pl-c1\"\u003eCHECK_READY\u003c/span\u003e(person);\n promise-\u0026gt;\u003cspan class=\"pl-c1\"\u003eset\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003efind\u003c/span\u003e(person-\u0026gt;\u003cspan class=\"pl-smi\"\u003emother\u003c/span\u003e));\n }\n \u003cspan class=\"pl-k\"\u003edelete\u003c/span\u003e promise;\n });\n\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e mother;\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eUsing \u003ccode\u003eFuture::then()\u003c/code\u003e this can be simplified to:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::Future;\n\n// Returns an instance of `Person` for the specified `name`.\nFuture\u0026lt;Person\u0026gt; find(const std::string\u0026amp; name);\n\n// Returns the mother (an instance of `Person`) of the specified `name`.\nFuture\u0026lt;Person\u0026gt; mother(const std::string\u0026amp; name)\n{\n return find(name)\n .then([](const Person\u0026amp; person) {\n return find(person.mother);\n });\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Future;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Returns an instance of `Person` for the specified `name`.\u003c/span\u003e\nFuture\u0026lt;Person\u0026gt; \u003cspan class=\"pl-en\"\u003efind\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e std::string\u0026amp; name);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Returns the mother (an instance of `Person`) of the specified `name`.\u003c/span\u003e\nFuture\u0026lt;Person\u0026gt; \u003cspan class=\"pl-en\"\u003emother\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e std::string\u0026amp; name)\n{\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003efind\u003c/span\u003e(name)\n .\u003cspan class=\"pl-c1\"\u003ethen\u003c/span\u003e([](\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e Person\u0026amp; person) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003efind\u003c/span\u003e(person.\u003cspan class=\"pl-smi\"\u003emother\u003c/span\u003e);\n });\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eEach of \u003ccode\u003eFuture::then()\u003c/code\u003e, \u003ccode\u003eFuture::repair()\u003c/code\u003e, and \u003ccode\u003eFuture::recover()\u003c/code\u003e takes a callback that will be invoked after certain transitions, captured by this table:\u003c/p\u003e\n\u003cmarkdown-accessiblity-table\u003e\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eTransition\u003c/th\u003e\n\u003cth\u003e\u003ccode\u003eFuture::*()\u003c/code\u003e\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eREADY\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003eFuture::then(F\u0026amp;\u0026amp;)\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eFAILED\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003eFuture::repair(F\u0026amp;\u0026amp;)\u003c/code\u003e and \u003ccode\u003eFuture::recover(F\u0026amp;\u0026amp;)\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003ccode\u003eDISCARDED\u003c/code\u003e\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003eFuture::recover(F\u0026amp;\u0026amp;)\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eAbandoned (\u003ccode\u003ePENDING\u003c/code\u003e and \u003ccode\u003eFuture::isAbandoned()\u003c/code\u003e)\u003c/td\u003e\n\u003ctd\u003e\u003ccode\u003eFuture::recover(F\u0026amp;\u0026amp;)\u003c/code\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\u003c/markdown-accessiblity-table\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eFuture::then()\u003c/code\u003e allows you to \u003cem\u003etransform\u003c/em\u003e the type of the \u003ccode\u003eFuture\u003c/code\u003e into a new type but both \u003ccode\u003eFuture::repair()\u003c/code\u003e and \u003ccode\u003eFuture::recover()\u003c/code\u003e must return the same type as \u003ccode\u003eFuture\u003c/code\u003e because they may not get executed! Here's an example using \u003ccode\u003eFuture::recover()\u003c/code\u003e to handle a failure:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::Future;\n\n// Returns an instance of `Person` for the specified `name`.\nFuture\u0026lt;Person\u0026gt; find(const std::string\u0026amp; name);\n\n// Returns a parent (an instance of `Person`) of the specified `name`.\nFuture\u0026lt;Person\u0026gt; parent(const std::string\u0026amp; name)\n{\n return find(name)\n .then([](const Person\u0026amp; person) {\n // Try to find the mother and if that fails try the father!\n return find(person.mother)\n .recover([=](const Future\u0026lt;Person\u0026gt;\u0026amp;) {\n return find(person.father);\n });\n });\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Future;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Returns an instance of `Person` for the specified `name`.\u003c/span\u003e\nFuture\u0026lt;Person\u0026gt; \u003cspan class=\"pl-en\"\u003efind\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e std::string\u0026amp; name);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Returns a parent (an instance of `Person`) of the specified `name`.\u003c/span\u003e\nFuture\u0026lt;Person\u0026gt; \u003cspan class=\"pl-en\"\u003eparent\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e std::string\u0026amp; name)\n{\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003efind\u003c/span\u003e(name)\n .\u003cspan class=\"pl-c1\"\u003ethen\u003c/span\u003e([](\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e Person\u0026amp; person) {\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Try to find the mother and if that fails try the father!\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003efind\u003c/span\u003e(person.\u003cspan class=\"pl-smi\"\u003emother\u003c/span\u003e)\n .\u003cspan class=\"pl-c1\"\u003erecover\u003c/span\u003e([=](\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e Future\u0026lt;Person\u0026gt;\u0026amp;) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003efind\u003c/span\u003e(person.\u003cspan class=\"pl-smi\"\u003efather\u003c/span\u003e);\n });\n });\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003e\u003cbr\u003e \u003cstrong\u003eBe careful what you capture in your callbacks! Depending on the state of the future the callback may be executed from a different scope and what ever you captured may no longer be valid; see \u003ca href=\"#futures-and-promises-callback-semantics\"\u003eCallback Semantics\u003c/a\u003e for more details.\u003c/strong\u003e \u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-futures-and-promises-discarding-and-composition\"\u003e\u003c/a\u003e Discarding and Composition\u003c/h3\u003e\u003ca id=\"user-content--discarding-and-composition\" class=\"anchor\" aria-label=\"Permalink: Discarding and Composition\" href=\"#-discarding-and-composition\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eDoing a \u003ccode\u003eFuture::discard()\u003c/code\u003e will \u003cem\u003epropagate\u003c/em\u003e through each of the futures composed with \u003ccode\u003eFuture::then()\u003c/code\u003e, \u003ccode\u003eFuture::recover()\u003c/code\u003e, etc. This is usually what you want, but there are two important caveats to look out for:\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-futures-and-promises-then-discards\"\u003e\u003c/a\u003e 1. \u003ccode\u003eFuture::then()\u003c/code\u003e enforces discards\u003c/h4\u003e\u003ca id=\"user-content--1-futurethen-enforces-discards\" class=\"anchor\" aria-label=\"Permalink: 1. Future::then() enforces discards\" href=\"#-1-futurethen-enforces-discards\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe future returned by \u003ccode\u003eFuture::then()\u003c/code\u003e \u003cem\u003ewill not execute the callback if a discard has been requested.\u003c/em\u003e That is, even if the future transitions to \u003ccode\u003eREADY\u003c/code\u003e, \u003ccode\u003eFuture::then()\u003c/code\u003e will still enforce the request to discard and transition the future to \u003ccode\u003eDISCARDED\u003c/code\u003e.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003e\u003cbr\u003e These semantics are surprising to many, and, admittedly, the library may at one point in the future change the semantics and introduce a \u003ccode\u003ediscardable()\u003c/code\u003e helper for letting people explicitly decide if/when they want a callback to be discarded. Historically, these semantics were chosen so that people could write infinite loops using \u003ccode\u003eFuture::then()\u003c/code\u003e that could be interrupted with \u003ccode\u003eFuture::discard()\u003c/code\u003e. The proper way to do infinte loops today is with \u003ccode\u003eloop()\u003c/code\u003e. \u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp dir=\"auto\"\u003eHere's an example to clarify this caveat:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::Future;\nusing process::Promise;\n\nint main(int argc, char** argv)\n{\n Promise\u0026lt;int\u0026gt; promise;\n\n Future\u0026lt;std::string\u0026gt; future = promise.future()\n .then([](int i) {\n return stringify(i);\n });\n\n future.discard();\n\n CHECK_PENDING(future);\n\n promise.set(42);\n\n CHECK_DISCARDED(future); // EVEN THOUGH THE PROMISE COMPLETED SUCCESSFULLY!\n\n return 0;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Future;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Promise;\n\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emain\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e argc, \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e** argv)\n{\n Promise\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt; promise;\n\n Future\u0026lt;std::string\u0026gt; future = promise.\u003cspan class=\"pl-c1\"\u003efuture\u003c/span\u003e()\n .\u003cspan class=\"pl-c1\"\u003ethen\u003c/span\u003e([](\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e i) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003estringify\u003c/span\u003e(i);\n });\n\n future.\u003cspan class=\"pl-c1\"\u003ediscard\u003c/span\u003e();\n\n \u003cspan class=\"pl-c1\"\u003eCHECK_PENDING\u003c/span\u003e(future);\n\n promise.\u003cspan class=\"pl-c1\"\u003eset\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e42\u003c/span\u003e);\n\n \u003cspan class=\"pl-c1\"\u003eCHECK_DISCARDED\u003c/span\u003e(future); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e EVEN THOUGH THE PROMISE COMPLETED SUCCESSFULLY!\u003c/span\u003e\n\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e;\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-futures-and-promises-undiscardable\"\u003e\u003c/a\u003e 2. Sometimes you want something to be \u003ccode\u003eundiscardable()\u003c/code\u003e\u003c/h4\u003e\u003ca id=\"user-content--2-sometimes-you-want-something-to-be-undiscardable\" class=\"anchor\" aria-label=\"Permalink: 2. Sometimes you want something to be undiscardable()\" href=\"#-2-sometimes-you-want-something-to-be-undiscardable\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou may find yourself in a circumstance when you're referencing (or composing) futures but \u003cem\u003eyou don't want a disard to propagate to the referenced future!\u003c/em\u003e Consider some code that needs to complete some expensive initialization before other functions can be called. We can model that by composing each function with the initialization, for example:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::Future;\n\nFuture\u0026lt;T\u0026gt; foo()\n{\n return initialization\n .then([](...) {\n return ...;\n });\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Future;\n\nFuture\u0026lt;T\u0026gt; \u003cspan class=\"pl-en\"\u003efoo\u003c/span\u003e()\n{\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e initialization\n .\u003cspan class=\"pl-c1\"\u003ethen\u003c/span\u003e([](...) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e ...;\n });\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIn the above example, if someone were to discard the future returned from \u003ccode\u003efoo()\u003c/code\u003e \u003cem\u003ethey would also end up discarding the initialization!\u003c/em\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe real intention here is to compose with the initialization but not propagate discarding. This can be accomplished using \u003ccode\u003eundiscardable()\u003c/code\u003e which acts as a barrier to stop a discard from propagating through. Here's how the previous example would look with \u003ccode\u003eundiscardable()\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::Future;\nusing process::undiscardable;\n\nFuture\u0026lt;T\u0026gt; foo()\n{\n return undiscardable(initialization)\n .then([](...) {\n return ...;\n });\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Future;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::undiscardable;\n\nFuture\u0026lt;T\u0026gt; \u003cspan class=\"pl-en\"\u003efoo\u003c/span\u003e()\n{\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eundiscardable\u003c/span\u003e(initialization)\n .\u003cspan class=\"pl-c1\"\u003ethen\u003c/span\u003e([](...) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e ...;\n });\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-futures-and-promises-callback-semantics\"\u003e\u003c/a\u003e Callback Semantics\u003c/h3\u003e\u003ca id=\"user-content--callback-semantics\" class=\"anchor\" aria-label=\"Permalink: Callback Semantics\" href=\"#-callback-semantics\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThere are two possible ways in which the callbacks to the \u003ccode\u003eFuture::onReady()\u003c/code\u003e family of functions as well as the composition functions like \u003ccode\u003eFuture::then()\u003c/code\u003e get invoked:\u003c/p\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003eBy the caller of \u003ccode\u003eFuture::onReady()\u003c/code\u003e, \u003ccode\u003eFuture::then()\u003c/code\u003e, etc.\u003c/li\u003e\n\u003cli\u003eBy the caller of \u003ccode\u003ePromise::set()\u003c/code\u003e, \u003ccode\u003ePromise::fail()\u003c/code\u003e, etc.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp dir=\"auto\"\u003eThe first case occurs if the future is already transitioned to that state when adding the callback, i.e., if the state is already \u003ccode\u003eREADY\u003c/code\u003e for either \u003ccode\u003eFuture::onReady()\u003c/code\u003e or \u003ccode\u003eFuture::then()\u003c/code\u003e, or \u003ccode\u003eFAILED\u003c/code\u003e for \u003ccode\u003eFuture::onFailed()\u003c/code\u003e or \u003ccode\u003eFuture::recover()\u003c/code\u003e, etc, then the callback will be executed immediately.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe second case occurs if the future has not yet transitioned to that state. In that case the callback is stored and it is executed by the caller of \u003ccode\u003ePromise::set()\u003c/code\u003e, \u003ccode\u003ePromise::fail()\u003c/code\u003e, whoever is deleting the promise (for abandonment), etc.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003cem\u003eThis means that it is critical to consider the synchronization that might be necessary for your code given that multiple possible callers could execute the callback!\u003c/em\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eWe call these callback semantics \u003cem\u003esynchronous\u003c/em\u003e, as opposed to \u003cem\u003easynchronous\u003c/em\u003e. You can use \u003ccode\u003edefer()\u003c/code\u003e in order to \u003cem\u003easynchronously\u003c/em\u003e invoke your callbacks.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003e\u003cbr\u003e Note that after the callbacks are invoked they are deleted, so any resources that you might be holding on to inside the callback will properly be released after the future transitions and it's callbacks are invoked. \u003cbr\u003e\u003cbr\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-futures-and-promises-check-overloads\"\u003e\u003c/a\u003e \u003ccode\u003eCHECK()\u003c/code\u003e Overloads\u003c/h3\u003e\u003ca id=\"user-content--check-overloads\" class=\"anchor\" aria-label=\"Permalink: CHECK() Overloads\" href=\"#-check-overloads\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eCHECK()\u003c/code\u003e is a macro from \u003ca href=\"https://github.com/google/googletest\"\u003eGoogle Test\u003c/a\u003e which acts like an \u003ccode\u003eassert\u003c/code\u003e but prints a stack trace and does better signal management. In addition to \u003ccode\u003eCHECK()\u003c/code\u003e, we've also created wrapper macros \u003ccode\u003eCHECK_PENDING()\u003c/code\u003e, \u003ccode\u003eCHECK_READY()\u003c/code\u003e, \u003ccode\u003eCHECK_FAILED()\u003c/code\u003e, \u003ccode\u003eCHECK_DISCARDED()\u003c/code\u003e which enables you to more concisely do things like \u003ccode\u003eCHECK_READY(future)\u003c/code\u003e in your tests.\u003c/p\u003e\n\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-http\"\u003e\u003c/a\u003e HTTP\u003c/h2\u003e\u003ca id=\"user-content--http\" class=\"anchor\" aria-label=\"Permalink: HTTP\" href=\"#-http\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003elibprocess provides facilities for communicating between actors via HTTP\nmessages. With the advent of the HTTP API, HTTP is becoming the preferred mode\nof communication.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ccode\u003eroute\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content-route\" class=\"anchor\" aria-label=\"Permalink: route\" href=\"#route\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eroute\u003c/code\u003e installs an HTTP endpoint onto a process. Let's define a simple process\nthat installs an endpoint upon initialization:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using namespace process;\nusing namespace process::http;\n\nclass HttpProcess : public Process\u0026lt;HttpProcess\u0026gt;\n{\nprotected:\n void initialize() override\n {\n route(\u0026quot;/testing\u0026quot;, None(), [](const Request\u0026amp; request) {\n return testing(request.query);\n });\n }\n};\n\n\nclass Http\n{\npublic:\n Http() : process(new HttpProcess())\n {\n spawn(process.get());\n }\n\n virtual ~Http()\n {\n terminate(process.get());\n wait(process.get());\n }\n\n Owned\u0026lt;HttpProcess\u0026gt; process;\n};\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enamespace\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eprocess\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e;\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enamespace\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eprocess\u003c/span\u003e::http\u003cspan class=\"pl-k\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eHttpProcess\u003c/span\u003e : \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eProcess\u003c/span\u003e\u0026lt;HttpProcess\u0026gt;\n{\n\u003cspan class=\"pl-k\"\u003eprotected:\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003einitialize\u003c/span\u003e() \u003cspan class=\"pl-k\"\u003eoverride\u003c/span\u003e\n {\n \u003cspan class=\"pl-c1\"\u003eroute\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e/testing\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003eNone\u003c/span\u003e(), [](\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e Request\u0026amp; request) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003etesting\u003c/span\u003e(request.\u003cspan class=\"pl-smi\"\u003equery\u003c/span\u003e);\n });\n }\n};\n\n\n\u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eHttp\u003c/span\u003e\n{\n\u003cspan class=\"pl-k\"\u003epublic:\u003c/span\u003e\n \u003cspan class=\"pl-en\"\u003eHttp\u003c/span\u003e() : process(\u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e HttpProcess())\n {\n \u003cspan class=\"pl-c1\"\u003espawn\u003c/span\u003e(process.\u003cspan class=\"pl-c1\"\u003eget\u003c/span\u003e());\n }\n\n \u003cspan class=\"pl-k\"\u003evirtual\u003c/span\u003e \u003cspan class=\"pl-en\"\u003e~Http\u003c/span\u003e()\n {\n \u003cspan class=\"pl-c1\"\u003eterminate\u003c/span\u003e(process.\u003cspan class=\"pl-c1\"\u003eget\u003c/span\u003e());\n \u003cspan class=\"pl-c1\"\u003ewait\u003c/span\u003e(process.\u003cspan class=\"pl-c1\"\u003eget\u003c/span\u003e());\n }\n\n Owned\u0026lt;HttpProcess\u0026gt; process;\n};\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eNow if our program instantiates this class, we can do something like:\n\u003ccode\u003e$ curl localhost:1234/testing?value=42\u003c/code\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eNote that the port at which this endpoint can be reached is the port libprocess\nhas bound to, which is determined by the \u003ccode\u003eLIBPROCESS_PORT\u003c/code\u003e environment variable.\nIn the case of the Mesos master or agent, this environment variable is set\naccording to the \u003ccode\u003e--port\u003c/code\u003e command-line flag.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ccode\u003eget\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content-get\" class=\"anchor\" aria-label=\"Permalink: get\" href=\"#get\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eget\u003c/code\u003e will hit an HTTP endpoint with a GET request and return a \u003ccode\u003eFuture\u003c/code\u003e\ncontaining the response. We can pass it either a libprocess \u003ccode\u003eUPID\u003c/code\u003e or a \u003ccode\u003eURL\u003c/code\u003e.\nHere's an example hitting the endpoint assuming we have a \u003ccode\u003eUPID\u003c/code\u003e named \u003ccode\u003eupid\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Future\u0026lt;Response\u0026gt; future = get(upid, \u0026quot;testing\u0026quot;);\"\u003e\u003cpre\u003eFuture\u0026lt;Response\u0026gt; future = get(upid, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etesting\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eOr let's assume our serving process has been set up on a remote server and we\nwant to hit its endpoint. We'll construct a \u003ccode\u003eURL\u003c/code\u003e for the address and then call\n\u003ccode\u003eget\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"URL url = URL(\u0026quot;http\u0026quot;, \u0026quot;hostname\u0026quot;, 1234, \u0026quot;/testing\u0026quot;);\n\nFuture\u0026lt;Response\u0026gt; future = get(url);\"\u003e\u003cpre\u003eURL url = URL(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ehttp\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ehostname\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e1234\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e/testing\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\n\nFuture\u0026lt;Response\u0026gt; future = get(url);\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ccode\u003epost\u003c/code\u003e and \u003ccode\u003erequestDelete\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content-post-and-requestdelete\" class=\"anchor\" aria-label=\"Permalink: post and requestDelete\" href=\"#post-and-requestdelete\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003epost\u003c/code\u003e and \u003ccode\u003erequestDelete\u003c/code\u003e functions will similarly send POST and DELETE\nrequests to an HTTP endpoint. Their invocation is analogous to \u003ccode\u003eget\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ccode\u003eConnection\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content-connection\" class=\"anchor\" aria-label=\"Permalink: Connection\" href=\"#connection\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA \u003ccode\u003eConnection\u003c/code\u003e represents a connection to an HTTP server. \u003ccode\u003econnect\u003c/code\u003e\ncan be used to connect to a server, and returns a \u003ccode\u003eFuture\u003c/code\u003e containing the\n\u003ccode\u003eConnection\u003c/code\u003e. Let's open a connection to a server and send some requests:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Future\u0026lt;Connection\u0026gt; connect = connect(url);\n\nconnect.await();\n\nConnection connection = connect.get();\n\nRequest request;\nrequest.method = \u0026quot;GET\u0026quot;;\nrequest.url = url;\nrequest.body = \u0026quot;Amazing prose goes here.\u0026quot;;\nrequest.keepAlive = true;\n\nFuture\u0026lt;Response\u0026gt; response = connection.send(request);\"\u003e\u003cpre\u003eFuture\u0026lt;Connection\u0026gt; connect = connect(url);\n\nconnect.await();\n\nConnection connection = connect.get();\n\nRequest request;\nrequest.method = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eGET\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\nrequest.url = url;\nrequest.body = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eAmazing prose goes here.\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\nrequest.keepAlive = \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e;\n\nFuture\u0026lt;Response\u0026gt; response = connection.send(request);\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIt's also worth noting that if multiple requests are sent in succession on a\n\u003ccode\u003eConnection\u003c/code\u003e, they will be automatically pipelined.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-processes\"\u003e\u003c/a\u003e Processes (aka Actors)\u003c/h2\u003e\u003ca id=\"user-content--processes-aka-actors\" class=\"anchor\" aria-label=\"Permalink: Processes (aka Actors)\" href=\"#-processes-aka-actors\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAn actor in libprocess is called a \u003cem\u003eprocess\u003c/em\u003e (not to be confused by an operating system process).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eA process receives events that it processes one at a time. Because a process is only processing one event at a time there's no need for synchronization within the process.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThere are a few ways to create an event for a process, the most important including:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eYou can \u003ccode\u003esend()\u003c/code\u003e a process a message.\u003c/li\u003e\n\u003cli\u003eYou can do a function \u003ccode\u003edispatch()\u003c/code\u003e on a process.\u003c/li\u003e\n\u003cli\u003eYou can send an \u003ccode\u003ehttp::Request\u003c/code\u003e to a process.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eThat last one is exceptionally powerful; every process is also an HTTP-based service that you can communicate with using the HTTP protocol.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eProcess Lifecycle\u003c/h3\u003e\u003ca id=\"user-content-process-lifecycle\" class=\"anchor\" aria-label=\"Permalink: Process Lifecycle\" href=\"#process-lifecycle\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou create a process like any other class in C++ but extending from \u003ccode\u003eProcess\u003c/code\u003e. \u003ccode\u003eProcess\u003c/code\u003e uses the \u003ca href=\"http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern\" rel=\"nofollow\"\u003ecuriously recurring template pattern (CRTP)\u003c/a\u003e to simplify types for some of it's methods (you'll see this with \u003ccode\u003eProcess::self()\u003c/code\u003e below).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003ePractically you can think of a process as a combination of a thread and an object, except creating/spawning a process is very cheap (no actual thread gets created, and no stack gets allocated).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eHere's the simplest process you can create:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::Process;\n\nclass FooProcess : public Process\u0026lt;FooProcess\u0026gt; {};\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Process;\n\n\u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eFooProcess\u003c/span\u003e : \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eProcess\u003c/span\u003e\u0026lt;FooProcess\u0026gt; {};\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou start a process using \u003ccode\u003espawn()\u003c/code\u003e, stop a process using \u003ccode\u003eterminate()\u003c/code\u003e, and wait for it to terminate by using \u003ccode\u003ewait()\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::Process;\nusing process::spawn;\nusing process::terminate;\nusing process::wait;\n\nclass FooProcess : public Process\u0026lt;FooProcess\u0026gt; {};\n\nint main(int argc, char** argv)\n{\n FooProcess process;\n spawn(process);\n terminate(process);\n wait(process);\n return 0;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Process;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::spawn;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::terminate;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::wait;\n\n\u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eFooProcess\u003c/span\u003e : \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eProcess\u003c/span\u003e\u0026lt;FooProcess\u0026gt; {};\n\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emain\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e argc, \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e** argv)\n{\n FooProcess process;\n \u003cspan class=\"pl-c1\"\u003espawn\u003c/span\u003e(process);\n \u003cspan class=\"pl-c1\"\u003eterminate\u003c/span\u003e(process);\n \u003cspan class=\"pl-c1\"\u003ewait\u003c/span\u003e(process);\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e;\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMemory Management\u003c/h4\u003e\u003ca id=\"user-content-memory-management\" class=\"anchor\" aria-label=\"Permalink: Memory Management\" href=\"#memory-management\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA process \u003cem\u003e\u003cstrong\u003eCAN NOT\u003c/strong\u003e\u003c/em\u003e be deleted until after doing a \u003ccode\u003ewait()\u003c/code\u003e, otherwise you might release resources that the library is still using! To simplify memory management you can ask the library to delete the process for you after it has completely terminated. You do this by invoking \u003ccode\u003espawn()\u003c/code\u003e and passing \u003ccode\u003etrue\u003c/code\u003e as the second argument:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::Process;\nusing process::spawn;\nusing process::terminate;\nusing process::wait;\n\nclass FooProcess : public Process\u0026lt;FooProcess\u0026gt; {};\n\nint main(int argc, char** argv)\n{\n FooProcess* process = new FooProcess();\n spawn(process, true); // \u0026lt;-- `process` will be automatically deleted!\n terminate(process);\n wait(process)\n return 0;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Process;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::spawn;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::terminate;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::wait;\n\n\u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eFooProcess\u003c/span\u003e : \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eProcess\u003c/span\u003e\u0026lt;FooProcess\u0026gt; {};\n\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emain\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e argc, \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e** argv)\n{\n FooProcess* process = \u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eFooProcess\u003c/span\u003e();\n \u003cspan class=\"pl-c1\"\u003espawn\u003c/span\u003e(process, \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e \u0026lt;-- `process` will be automatically deleted!\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003eterminate\u003c/span\u003e(process);\n \u003cspan class=\"pl-c1\"\u003ewait\u003c/span\u003e(process)\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e;\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eProcess Identity: \u003ccode\u003ePID\u003c/code\u003e and \u003ccode\u003eUPID\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content-process-identity-pid-and-upid\" class=\"anchor\" aria-label=\"Permalink: Process Identity: PID and UPID\" href=\"#process-identity-pid-and-upid\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA process is uniquely identifiable by it's process id which can be any arbitrary string (but only one process can be spawned at a time with the same id). The \u003ccode\u003ePID\u003c/code\u003e and \u003ccode\u003eUPID\u003c/code\u003e types encapsulate both the process id as well as the network address for the process, e.g., the IP and port where the process can be reached if libprocess was initialized with an IPv4 or IPv6 network address. You can get the \u003ccode\u003ePID\u003c/code\u003e of a process by calling it's \u003ccode\u003eself()\u003c/code\u003e method:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::PID;\nusing process::Process;\nusing process::spawn;\n\nclass FooProcess : public Process\u0026lt;FooProcess\u0026gt; {};\n\nint main(int argc, char** argv)\n{\n FooProcess process;\n spawn(process);\n\n PID\u0026lt;FooProcess\u0026gt; pid = process.self();\n\n return 0;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::PID;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Process;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::spawn;\n\n\u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eFooProcess\u003c/span\u003e : \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eProcess\u003c/span\u003e\u0026lt;FooProcess\u0026gt; {};\n\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emain\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e argc, \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e** argv)\n{\n FooProcess process;\n \u003cspan class=\"pl-c1\"\u003espawn\u003c/span\u003e(process);\n\n PID\u0026lt;FooProcess\u0026gt; pid = process.\u003cspan class=\"pl-c1\"\u003eself\u003c/span\u003e();\n\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e;\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA \u003ccode\u003eUPID\u003c/code\u003e is the \"\u003cstrong\u003eu\u003c/strong\u003entyped\" base class of \u003ccode\u003ePID\u003c/code\u003e.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003eIf you turn on logging you might see a \u003ccode\u003ePID\u003c/code\u003e/\u003ccode\u003eUPID\u003c/code\u003e printed out as \u003ccode\u003eid@ip:port\u003c/code\u003e.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eProcess Event Queue (aka Mailbox)\u003c/h3\u003e\u003ca id=\"user-content-process-event-queue-aka-mailbox\" class=\"anchor\" aria-label=\"Permalink: Process Event Queue (aka Mailbox)\" href=\"#process-event-queue-aka-mailbox\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eEach process has a queue of incoming \u003ccode\u003eEvent\u003c/code\u003e's that it processes one at a time. Other actor implementations often call this queue the \"mailbox\".\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThere are 5 different kinds of events that can be enqueued for a process:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ccode\u003eMessageEvent\u003c/code\u003e: a \u003ccode\u003eMessage\u003c/code\u003e has been received.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eDispatchEvent\u003c/code\u003e: a method on the process has been \"dispatched\".\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eHttpEvent\u003c/code\u003e: an \u003ccode\u003ehttp::Request\u003c/code\u003e has been received.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eExitedEvent\u003c/code\u003e: another process which has been \u003ca href=\"#links\"\u003elinked\u003c/a\u003e has terminated.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eTerminateEvent\u003c/code\u003e: the process has been requested to terminate.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eAn event is serviced one at a time by invoking the process' \u003ccode\u003eserve()\u003c/code\u003e method which by default invokes the process' \u003ccode\u003evisit()\u003c/code\u003e method corresponding to the underlying event type. Most actors don't need to override the implementation of \u003ccode\u003eserve()\u003c/code\u003e or \u003ccode\u003evisit()\u003c/code\u003e but can rely on higher-level abstractions that simplify serving the event (e.g., \u003ccode\u003eroute()\u003c/code\u003e, which make it easy to set up handlers for an \u003ccode\u003eHttpEvent\u003c/code\u003e, discussed below in \u003ca href=\"#http\"\u003eHTTP\u003c/a\u003e).\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ccode\u003eMessageEvent\u003c/code\u003e\u003c/h4\u003e\u003ca id=\"user-content-messageevent\" class=\"anchor\" aria-label=\"Permalink: MessageEvent\" href=\"#messageevent\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA \u003ccode\u003eMessageEvent\u003c/code\u003e gets enqueued for a process when it gets sent a \u003ccode\u003eMessage\u003c/code\u003e, either locally or remotely. You use \u003ccode\u003esend()\u003c/code\u003e to send a message from within a process and \u003ccode\u003epost()\u003c/code\u003e to send a message from outside a process. A \u003ccode\u003epost()\u003c/code\u003e sends a message without a return address because there is no process to reply to. Here's a classic ping pong example using \u003ccode\u003esend()\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using process::MessageEvent;\nusing process::PID;\nusing process::Process;\nusing process::spawn;\nusing process::terminate;\nusing process::wait;\n\nclass ClientProcess : public Process\u0026lt;ClientProcess\u0026gt;\n{\npublic:\n ClientProcess(const UPID\u0026amp; server) : server(server) {}\n\n void initialize() override\n {\n send(server, \u0026quot;ping\u0026quot;);\n }\n\n void visit(const MessageEvent\u0026amp; event) override\n {\n if (event.message.from == server \u0026amp;\u0026amp;\n event.message.name == \u0026quot;pong\u0026quot;) {\n terminate(self());\n }\n }\n};\n\nclass ServerProcess : public Process\u0026lt;ServerProcess\u0026gt;\n{\npublic:\nprotected:\n void visit(const MessageEvent\u0026amp; event) override\n {\n if (event.message.name == \u0026quot;ping\u0026quot;) {\n send(event.message.from, \u0026quot;pong\u0026quot;);\n }\n terminate(self());\n }\n};\n\nint main(int argc, char** argv)\n{\n PID\u0026lt;ServerProcess\u0026gt; server = spawn(new ServerProcess(), true);\n PID\u0026lt;ClientProcess\u0026gt; client = spawn(new ClientProcess(server), true);\n\n wait(server);\n wait(client);\n\n return 0;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::MessageEvent;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::PID;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::Process;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::spawn;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::terminate;\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e process::wait;\n\n\u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eClientProcess\u003c/span\u003e : \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eProcess\u003c/span\u003e\u0026lt;ClientProcess\u0026gt;\n{\n\u003cspan class=\"pl-k\"\u003epublic:\u003c/span\u003e\n \u003cspan class=\"pl-en\"\u003eClientProcess\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e UPID\u0026amp; server) : server(server) {}\n\n \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003einitialize\u003c/span\u003e() \u003cspan class=\"pl-k\"\u003eoverride\u003c/span\u003e\n {\n \u003cspan class=\"pl-c1\"\u003esend\u003c/span\u003e(server, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eping\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\n }\n\n \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003evisit\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e MessageEvent\u0026amp; event) \u003cspan class=\"pl-k\"\u003eoverride\u003c/span\u003e\n {\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (event.\u003cspan class=\"pl-smi\"\u003emessage\u003c/span\u003e.\u003cspan class=\"pl-smi\"\u003efrom\u003c/span\u003e == server \u0026amp;\u0026amp;\n event.\u003cspan class=\"pl-smi\"\u003emessage\u003c/span\u003e.\u003cspan class=\"pl-smi\"\u003ename\u003c/span\u003e == \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003epong\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e) {\n \u003cspan class=\"pl-c1\"\u003eterminate\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003eself\u003c/span\u003e());\n }\n }\n};\n\n\u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eServerProcess\u003c/span\u003e : \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eProcess\u003c/span\u003e\u0026lt;ServerProcess\u0026gt;\n{\n\u003cspan class=\"pl-k\"\u003epublic:\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eprotected:\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003evisit\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e MessageEvent\u0026amp; event) \u003cspan class=\"pl-k\"\u003eoverride\u003c/span\u003e\n {\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (event.\u003cspan class=\"pl-smi\"\u003emessage\u003c/span\u003e.\u003cspan class=\"pl-smi\"\u003ename\u003c/span\u003e == \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eping\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e) {\n \u003cspan class=\"pl-c1\"\u003esend\u003c/span\u003e(event.\u003cspan class=\"pl-smi\"\u003emessage\u003c/span\u003e.\u003cspan class=\"pl-smi\"\u003efrom\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003epong\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\n }\n \u003cspan class=\"pl-c1\"\u003eterminate\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003eself\u003c/span\u003e());\n }\n};\n\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emain\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e argc, \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e** argv)\n{\n PID\u0026lt;ServerProcess\u0026gt; server = \u003cspan class=\"pl-c1\"\u003espawn\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eServerProcess\u003c/span\u003e(), \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e);\n PID\u0026lt;ClientProcess\u0026gt; client = \u003cspan class=\"pl-c1\"\u003espawn\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003enew\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003eClientProcess\u003c/span\u003e(server), \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e);\n\n \u003cspan class=\"pl-c1\"\u003ewait\u003c/span\u003e(server);\n \u003cspan class=\"pl-c1\"\u003ewait\u003c/span\u003e(client);\n\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e;\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ccode\u003eDispatchEvent\u003c/code\u003e\u003c/h4\u003e\u003ca id=\"user-content-dispatchevent\" class=\"anchor\" aria-label=\"Permalink: DispatchEvent\" href=\"#dispatchevent\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTODO.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ccode\u003eHttpEvent\u003c/code\u003e\u003c/h4\u003e\u003ca id=\"user-content-httpevent\" class=\"anchor\" aria-label=\"Permalink: HttpEvent\" href=\"#httpevent\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTODO.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ccode\u003eExitedEvent\u003c/code\u003e\u003c/h4\u003e\u003ca id=\"user-content-exitedevent\" class=\"anchor\" aria-label=\"Permalink: ExitedEvent\" href=\"#exitedevent\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTODO.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ccode\u003eTerminateEvent\u003c/code\u003e\u003c/h4\u003e\u003ca id=\"user-content-terminateevent\" class=\"anchor\" aria-label=\"Permalink: TerminateEvent\" href=\"#terminateevent\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTODO.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-async-pimpl\"\u003e\u003c/a\u003e Processes and the Asynchronous Pimpl Pattern\u003c/h3\u003e\u003ca id=\"user-content--processes-and-the-asynchronous-pimpl-pattern\" class=\"anchor\" aria-label=\"Permalink: Processes and the Asynchronous Pimpl Pattern\" href=\"#-processes-and-the-asynchronous-pimpl-pattern\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIt's tedious to require everyone to have to explicitly \u003ccode\u003espawn()\u003c/code\u003e, \u003ccode\u003eterminate()\u003c/code\u003e, and \u003ccode\u003ewait()\u003c/code\u003e for a process. Having everyone call \u003ccode\u003edispatch()\u003c/code\u003e when they really just want to invoke a function (albeit asynchronously) is unfortnate too! To alleviate these burdenes, a common pattern that is used is to wrap a process within another class that performs the \u003ccode\u003espawn()\u003c/code\u003e, \u003ccode\u003eterminate()\u003c/code\u003e, \u003ccode\u003ewait()\u003c/code\u003e, and \u003ccode\u003edispatch()\u003c/code\u003e's for you. Here's a typical example:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"class FooProcess : public Process\u0026lt;FooProcess\u0026gt;\n{\npublic:\n void foo(int i);\n};\n\nclass Foo\n{\npublic:\n Foo()\n {\n process::spawn(process);\n }\n\n ~Foo()\n {\n process::terminate(process);\n process::wait(process);\n }\n\n void foo(int i)\n {\n dispatch(process, \u0026amp;FooProcess::foo, i);\n }\n\nprivate:\n FooProcess process;\n};\n\nint main(int argc, char** argv)\n{\n Foo foo;\n\n foo.foo(42);\n\n return 0;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eFooProcess\u003c/span\u003e : \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eProcess\u003c/span\u003e\u0026lt;FooProcess\u0026gt;\n{\n\u003cspan class=\"pl-k\"\u003epublic:\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003efoo\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e i);\n};\n\n\u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eFoo\u003c/span\u003e\n{\n\u003cspan class=\"pl-k\"\u003epublic:\u003c/span\u003e\n \u003cspan class=\"pl-en\"\u003eFoo\u003c/span\u003e()\n {\n \u003cspan class=\"pl-c1\"\u003eprocess::spawn\u003c/span\u003e(process);\n }\n\n \u003cspan class=\"pl-en\"\u003e~Foo\u003c/span\u003e()\n {\n \u003cspan class=\"pl-c1\"\u003eprocess::terminate\u003c/span\u003e(process);\n \u003cspan class=\"pl-c1\"\u003eprocess::wait\u003c/span\u003e(process);\n }\n\n \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003efoo\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e i)\n {\n \u003cspan class=\"pl-c1\"\u003edispatch\u003c/span\u003e(process, \u0026amp;FooProcess::foo, i);\n }\n\n\u003cspan class=\"pl-k\"\u003eprivate:\u003c/span\u003e\n FooProcess process;\n};\n\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emain\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e argc, \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e** argv)\n{\n Foo foo;\n\n foo.\u003cspan class=\"pl-c1\"\u003efoo\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e42\u003c/span\u003e);\n\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e;\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAnyone using \u003ccode\u003eFoo\u003c/code\u003e uses it similarly to how they would work with any other \u003cem\u003esynchronous\u003c/em\u003e object where they don't know, or need to know, the implementation details under the covers (i.e., that it's implemented using a process). This is similar to the \u003ca href=\"https://en.wikipedia.org/wiki/Opaque_pointer\" rel=\"nofollow\"\u003ePimpl\u003c/a\u003e pattern, except we need to \u003ccode\u003espawn()\u003c/code\u003e and \u003ccode\u003eterminate()/wait()\u003c/code\u003e and rather than \u003cem\u003esynchronously\u003c/em\u003e invoking the underlying object we're \u003cem\u003easynchronously\u003c/em\u003e invoking the underlying object using \u003ccode\u003edispatch()\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-clock\"\u003e\u003c/a\u003e Clock Management and Timeouts\u003c/h2\u003e\u003ca id=\"user-content--clock-management-and-timeouts\" class=\"anchor\" aria-label=\"Permalink: Clock Management and Timeouts\" href=\"#-clock-management-and-timeouts\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAsynchronous programs often use timeouts, e.g., because a process that initiates\nan asynchronous operation wants to take action if the operation hasn't completed\nwithin a certain time bound. To facilitate this, libprocess provides a set of\nabstractions that simplify writing timeout logic. Importantly, test code has the\nability to manipulate the clock, in order to ensure that timeout logic is\nexercised (without needing to block the test program until the appropriate\namount of system time has elapsed).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTo invoke a function after a certain amount of time has elapsed, use \u003ccode\u003edelay\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using namespace process;\n\nclass DelayedProcess : public Process\u0026lt;DelayedProcess\u0026gt;\n{\npublic:\n void action(const string\u0026amp; name)\n {\n LOG(INFO) \u0026lt;\u0026lt; \u0026quot;hello, \u0026quot; \u0026lt;\u0026lt; name;\n\n promise.set(Nothing());\n }\n\n Promise\u0026lt;Nothing\u0026gt; promise;\n};\n\n\nint main()\n{\n DelayedProcess process;\n\n spawn(process);\n\n LOG(INFO) \u0026lt;\u0026lt; \u0026quot;Starting to wait\u0026quot;;\n\n delay(Seconds(5), process.self(), \u0026amp;DelayedProcess::action, \u0026quot;Neil\u0026quot;);\n\n AWAIT_READY(process.promise.future());\n\n LOG(INFO) \u0026lt;\u0026lt; \u0026quot;Done waiting\u0026quot;;\n\n terminate(process);\n wait(process);\n\n return 0;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enamespace\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eprocess\u003c/span\u003e\u003cspan class=\"pl-k\"\u003e;\u003c/span\u003e\n\n\u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eDelayedProcess\u003c/span\u003e : \u003cspan class=\"pl-k\"\u003epublic\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eProcess\u003c/span\u003e\u0026lt;DelayedProcess\u0026gt;\n{\n\u003cspan class=\"pl-k\"\u003epublic:\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eaction\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e string\u0026amp; name)\n {\n \u003cspan class=\"pl-c1\"\u003eLOG\u003c/span\u003e(INFO) \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ehello, \u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u0026lt;\u0026lt; name;\n\n promise.\u003cspan class=\"pl-c1\"\u003eset\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003eNothing\u003c/span\u003e());\n }\n\n Promise\u0026lt;Nothing\u0026gt; promise;\n};\n\n\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emain\u003c/span\u003e()\n{\n DelayedProcess process;\n\n \u003cspan class=\"pl-c1\"\u003espawn\u003c/span\u003e(process);\n\n \u003cspan class=\"pl-c1\"\u003eLOG\u003c/span\u003e(INFO) \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eStarting to wait\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\n\n \u003cspan class=\"pl-c1\"\u003edelay\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003eSeconds\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e5\u003c/span\u003e), process.\u003cspan class=\"pl-c1\"\u003eself\u003c/span\u003e(), \u0026amp;DelayedProcess::action, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eNeil\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\n\n \u003cspan class=\"pl-c1\"\u003eAWAIT_READY\u003c/span\u003e(process.\u003cspan class=\"pl-smi\"\u003epromise\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003efuture\u003c/span\u003e());\n\n \u003cspan class=\"pl-c1\"\u003eLOG\u003c/span\u003e(INFO) \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eDone waiting\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\n\n \u003cspan class=\"pl-c1\"\u003eterminate\u003c/span\u003e(process);\n \u003cspan class=\"pl-c1\"\u003ewait\u003c/span\u003e(process);\n\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e;\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis invokes the \u003ccode\u003eaction\u003c/code\u003e function after (at least) five seconds of time\nhave elapsed. When writing unit tests for this code, blocking the test for five\nseconds is undesirable. To avoid this, we can use \u003ccode\u003eClock::advance\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"\nint main()\n{\n DelayedProcess process;\n\n spawn(process);\n\n LOG(INFO) \u0026lt;\u0026lt; \u0026quot;Starting to wait\u0026quot;;\n\n Clock::pause();\n\n delay(Seconds(5), process.self(), \u0026amp;DelayedProcess::action, \u0026quot;Neil\u0026quot;);\n\n Clock::advance(Seconds(5));\n\n AWAIT_READY(process.promise.future());\n\n LOG(INFO) \u0026lt;\u0026lt; \u0026quot;Done waiting\u0026quot;;\n\n terminate(process);\n wait(process);\n\n Clock::resume();\n\n return 0;\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emain\u003c/span\u003e()\n{\n DelayedProcess process;\n\n \u003cspan class=\"pl-c1\"\u003espawn\u003c/span\u003e(process);\n\n \u003cspan class=\"pl-c1\"\u003eLOG\u003c/span\u003e(INFO) \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eStarting to wait\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\n\n \u003cspan class=\"pl-c1\"\u003eClock::pause\u003c/span\u003e();\n\n \u003cspan class=\"pl-c1\"\u003edelay\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003eSeconds\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e5\u003c/span\u003e), process.\u003cspan class=\"pl-c1\"\u003eself\u003c/span\u003e(), \u0026amp;DelayedProcess::action, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eNeil\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\n\n \u003cspan class=\"pl-c1\"\u003eClock::advance\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003eSeconds\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003e5\u003c/span\u003e));\n\n \u003cspan class=\"pl-c1\"\u003eAWAIT_READY\u003c/span\u003e(process.\u003cspan class=\"pl-smi\"\u003epromise\u003c/span\u003e.\u003cspan class=\"pl-c1\"\u003efuture\u003c/span\u003e());\n\n \u003cspan class=\"pl-c1\"\u003eLOG\u003c/span\u003e(INFO) \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eDone waiting\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\n\n \u003cspan class=\"pl-c1\"\u003eterminate\u003c/span\u003e(process);\n \u003cspan class=\"pl-c1\"\u003ewait\u003c/span\u003e(process);\n\n \u003cspan class=\"pl-c1\"\u003eClock::resume\u003c/span\u003e();\n\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e;\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-miscellaneous-primitives\"\u003e\u003c/a\u003e Miscellaneous Primitives\u003c/h2\u003e\u003ca id=\"user-content--miscellaneous-primitives\" class=\"anchor\" aria-label=\"Permalink: Miscellaneous Primitives\" href=\"#-miscellaneous-primitives\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ccode\u003easync\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content-async\" class=\"anchor\" aria-label=\"Permalink: async\" href=\"#async\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAsync defines a function template for asynchronously executing\nfunction closures. It provides their results as\n\u003ca href=\"#futures-and-promises\"\u003efutures\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca name=\"user-content-optimized-run-queue-event-queue\"\u003e\u003c/a\u003e Optimized Run Queue and Event Queue\u003c/h2\u003e\u003ca id=\"user-content--optimized-run-queue-and-event-queue\" class=\"anchor\" aria-label=\"Permalink: Optimized Run Queue and Event Queue\" href=\"#-optimized-run-queue-and-event-queue\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThere are a handful of compile-time optimizations that can be\nconfigured to improve the run queue and event queue performance. These\nare currently not enabled by default as they are considered\n\u003cem\u003e\u003cstrong\u003ealpha\u003c/strong\u003e\u003c/em\u003e. These optimizations include:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003e--enable-lock-free-run-queue\u003c/code\u003e (autotools) or\n\u003ccode\u003e-DENABLE_LOCK_FREE_RUN_QUEUE\u003c/code\u003e (cmake) which enables the lock-free\nrun queue implementation.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003e--enable-lock-free-event-queue\u003c/code\u003e (autotools) or\n\u003ccode\u003e-DENABLE_LOCK_FREE_EVENT_QUEUE\u003c/code\u003e (cmake) which enables the lock-free\nevent queue implementation.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003e--enable-last-in-first-out-fixed-size-semaphore\u003c/code\u003e (autotools) or\n\u003ccode\u003e-DENABLE_LAST_IN_FIRST_OUT_FIXED_SIZE_SEMAPHORE\u003c/code\u003e (cmake) which\nenables an optimized semaphore implementation.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eDetails\u003c/h4\u003e\u003ca id=\"user-content-details\" class=\"anchor\" aria-label=\"Permalink: Details\" href=\"#details\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eBoth the lock-free run queue implementation and the lock-free event\nqueue implementation use \u003ccode\u003emoodycamel::ConcurrentQueue\u003c/code\u003e which can be\nfound \u003ca href=\"https://github.com/cameron314/concurrentqueue\"\u003ehere\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eFor the run queue we use a semaphore to block threads when there are\nnot any processes to run. On Linux we found that using a semaphore\nfrom glibc (i.e., \u003ccode\u003esem_create\u003c/code\u003e, \u003ccode\u003esem_wait\u003c/code\u003e, \u003ccode\u003esem_post\u003c/code\u003e, etc) had some\nperformance issues. We discuss those performance issues and how our\noptimized semaphore overcomes them in more detail in\n\u003ca href=\"https://github.com/apache/mesos/blob/master/3rdparty/libprocess/src/semaphore.hpp#L191\"\u003esemaphore.hpp\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eBenchmark\u003c/h4\u003e\u003ca id=\"user-content-benchmark\" class=\"anchor\" aria-label=\"Permalink: Benchmark\" href=\"#benchmark\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe benchmark that we've used to drive the run queue and event queue\nperformance improvements can be found in\n\u003ca href=\"https://github.com/apache/mesos/blob/master/3rdparty/libprocess/src/tests/benchmarks.cpp#L426\"\u003ebenchmarks.cpp\u003c/a\u003e. You\ncan run the benchmark yourself by invoking \u003ccode\u003e./benchmarks --gtest_filter=ProcessTest.*ThroughputPerformance\u003c/code\u003e.\u003c/p\u003e\n\u003c/article\u003e","renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":false,"symbols":[{"name":"Libprocess User Guide","kind":"section_1","ident_start":2,"ident_end":23,"extent_start":0,"extent_end":30302,"fully_qualified_name":"Libprocess User Guide","ident_utf16":{"start":{"line_number":0,"utf16_col":2},"end":{"line_number":0,"utf16_col":23}},"extent_utf16":{"start":{"line_number":0,"utf16_col":0},"end":{"line_number":837,"utf16_col":0}}},{"name":"Table of Contents","kind":"section_2","ident_start":491,"ident_end":508,"extent_start":488,"extent_end":849,"fully_qualified_name":"Table of Contents","ident_utf16":{"start":{"line_number":6,"utf16_col":3},"end":{"line_number":6,"utf16_col":20}},"extent_utf16":{"start":{"line_number":6,"utf16_col":0},"end":{"line_number":19,"utf16_col":0}}},{"name":"\u003ca name=\"presentations\"\u003e\u003c/a\u003e Presentations","kind":"section_2","ident_start":852,"ident_end":894,"extent_start":849,"extent_end":1107,"fully_qualified_name":"\u003ca name=\"presentations\"\u003e\u003c/a\u003e Presentations","ident_utf16":{"start":{"line_number":19,"utf16_col":3},"end":{"line_number":19,"utf16_col":45}},"extent_utf16":{"start":{"line_number":19,"utf16_col":0},"end":{"line_number":26,"utf16_col":0}}},{"name":"\u003ca name=\"overview\"\u003e\u003c/a\u003e Overview","kind":"section_2","ident_start":1110,"ident_end":1142,"extent_start":1107,"extent_end":1773,"fully_qualified_name":"\u003ca name=\"overview\"\u003e\u003c/a\u003e Overview","ident_utf16":{"start":{"line_number":26,"utf16_col":3},"end":{"line_number":26,"utf16_col":35}},"extent_utf16":{"start":{"line_number":26,"utf16_col":0},"end":{"line_number":36,"utf16_col":0}}},{"name":"\u003ca name=\"futures-and-promises\"\u003e\u003c/a\u003e Futures and Promises","kind":"section_2","ident_start":1776,"ident_end":1832,"extent_start":1773,"extent_end":16586,"fully_qualified_name":"\u003ca name=\"futures-and-promises\"\u003e\u003c/a\u003e Futures and Promises","ident_utf16":{"start":{"line_number":36,"utf16_col":3},"end":{"line_number":36,"utf16_col":59}},"extent_utf16":{"start":{"line_number":36,"utf16_col":0},"end":{"line_number":376,"utf16_col":0}}},{"name":"\u003ca name=\"futures-and-promises-basics\"\u003e\u003c/a\u003e Basics","kind":"section_3","ident_start":2716,"ident_end":2765,"extent_start":2712,"extent_end":3872,"fully_qualified_name":"\u003ca name=\"futures-and-promises-basics\"\u003e\u003c/a\u003e Basics","ident_utf16":{"start":{"line_number":53,"utf16_col":4},"end":{"line_number":53,"utf16_col":53}},"extent_utf16":{"start":{"line_number":53,"utf16_col":0},"end":{"line_number":85,"utf16_col":0}}},{"name":"\u003ca name=\"futures-and-promises-states\"\u003e\u003c/a\u003e States","kind":"section_3","ident_start":3876,"ident_end":3925,"extent_start":3872,"extent_end":5974,"fully_qualified_name":"\u003ca name=\"futures-and-promises-states\"\u003e\u003c/a\u003e States","ident_utf16":{"start":{"line_number":85,"utf16_col":4},"end":{"line_number":85,"utf16_col":53}},"extent_utf16":{"start":{"line_number":85,"utf16_col":0},"end":{"line_number":105,"utf16_col":0}}},{"name":"\u003ca name=\"futures-and-promises-discarding-a-future\"\u003e\u003c/a\u003e Discarding a Future (aka Cancellation)","kind":"section_3","ident_start":5978,"ident_end":6072,"extent_start":5974,"extent_end":7362,"fully_qualified_name":"\u003ca name=\"futures-and-promises-discarding-a-future\"\u003e\u003c/a\u003e Discarding a Future (aka Cancellation)","ident_utf16":{"start":{"line_number":105,"utf16_col":4},"end":{"line_number":105,"utf16_col":98}},"extent_utf16":{"start":{"line_number":105,"utf16_col":0},"end":{"line_number":159,"utf16_col":0}}},{"name":"\u003ca name=\"futures-and-promises-abandoned-futures\"\u003e\u003c/a\u003e Abandoned Futures","kind":"section_3","ident_start":7366,"ident_end":7437,"extent_start":7362,"extent_end":8228,"fully_qualified_name":"\u003ca name=\"futures-and-promises-abandoned-futures\"\u003e\u003c/a\u003e Abandoned Futures","ident_utf16":{"start":{"line_number":159,"utf16_col":4},"end":{"line_number":159,"utf16_col":75}},"extent_utf16":{"start":{"line_number":159,"utf16_col":0},"end":{"line_number":187,"utf16_col":0}}},{"name":"\u003ca name=\"futures-and-promises-composition\"\u003e\u003c/a\u003e Composition: `Future::then()`, `Future::repair()`, and `Future::recover()`","kind":"section_3","ident_start":8232,"ident_end":8354,"extent_start":8228,"extent_end":11830,"fully_qualified_name":"\u003ca name=\"futures-and-promises-composition\"\u003e\u003c/a\u003e Composition: `Future::then()`, `Future::repair()`, and `Future::recover()`","ident_utf16":{"start":{"line_number":187,"utf16_col":4},"end":{"line_number":187,"utf16_col":126}},"extent_utf16":{"start":{"line_number":187,"utf16_col":0},"end":{"line_number":277,"utf16_col":0}}},{"name":"\u003ca name=\"futures-and-promises-discarding-and-composition\"\u003e\u003c/a\u003e Discarding and Composition","kind":"section_3","ident_start":11834,"ident_end":11923,"extent_start":11830,"extent_end":14575,"fully_qualified_name":"\u003ca name=\"futures-and-promises-discarding-and-composition\"\u003e\u003c/a\u003e Discarding and Composition","ident_utf16":{"start":{"line_number":277,"utf16_col":4},"end":{"line_number":277,"utf16_col":93}},"extent_utf16":{"start":{"line_number":277,"utf16_col":0},"end":{"line_number":347,"utf16_col":0}}},{"name":"\u003ca name=\"futures-and-promises-then-discards\"\u003e\u003c/a\u003e 1. `Future::then()` enforces discards","kind":"section_4","ident_start":12146,"ident_end":12233,"extent_start":12141,"extent_end":13400,"fully_qualified_name":"\u003ca name=\"futures-and-promises-then-discards\"\u003e\u003c/a\u003e 1. `Future::then()` enforces discards","ident_utf16":{"start":{"line_number":281,"utf16_col":5},"end":{"line_number":281,"utf16_col":92}},"extent_utf16":{"start":{"line_number":281,"utf16_col":0},"end":{"line_number":314,"utf16_col":0}}},{"name":"\u003ca name=\"futures-and-promises-undiscardable\"\u003e\u003c/a\u003e 2. Sometimes you want something to be `undiscardable()`","kind":"section_4","ident_start":13405,"ident_end":13510,"extent_start":13400,"extent_end":14575,"fully_qualified_name":"\u003ca name=\"futures-and-promises-undiscardable\"\u003e\u003c/a\u003e 2. Sometimes you want something to be `undiscardable()`","ident_utf16":{"start":{"line_number":314,"utf16_col":5},"end":{"line_number":314,"utf16_col":110}},"extent_utf16":{"start":{"line_number":314,"utf16_col":0},"end":{"line_number":347,"utf16_col":0}}},{"name":"\u003ca name=\"futures-and-promises-callback-semantics\"\u003e\u003c/a\u003e Callback Semantics","kind":"section_3","ident_start":14579,"ident_end":14652,"extent_start":14575,"extent_end":16055,"fully_qualified_name":"\u003ca name=\"futures-and-promises-callback-semantics\"\u003e\u003c/a\u003e Callback Semantics","ident_utf16":{"start":{"line_number":347,"utf16_col":4},"end":{"line_number":347,"utf16_col":77}},"extent_utf16":{"start":{"line_number":347,"utf16_col":0},"end":{"line_number":364,"utf16_col":0}}},{"name":"\u003ca name=\"futures-and-promises-check-overloads\"\u003e\u003c/a\u003e `CHECK()` Overloads","kind":"section_3","ident_start":16059,"ident_end":16130,"extent_start":16055,"extent_end":16586,"fully_qualified_name":"\u003ca name=\"futures-and-promises-check-overloads\"\u003e\u003c/a\u003e `CHECK()` Overloads","ident_utf16":{"start":{"line_number":364,"utf16_col":4},"end":{"line_number":364,"utf16_col":75}},"extent_utf16":{"start":{"line_number":364,"utf16_col":0},"end":{"line_number":376,"utf16_col":0}}},{"name":"\u003ca name=\"http\"\u003e\u003c/a\u003e HTTP","kind":"section_2","ident_start":16589,"ident_end":16613,"extent_start":16586,"extent_end":19220,"fully_qualified_name":"\u003ca name=\"http\"\u003e\u003c/a\u003e HTTP","ident_utf16":{"start":{"line_number":376,"utf16_col":3},"end":{"line_number":376,"utf16_col":27}},"extent_utf16":{"start":{"line_number":376,"utf16_col":0},"end":{"line_number":479,"utf16_col":0}}},{"name":"`route`","kind":"section_3","ident_start":16790,"ident_end":16797,"extent_start":16786,"extent_end":17806,"fully_qualified_name":"`route`","ident_utf16":{"start":{"line_number":382,"utf16_col":4},"end":{"line_number":382,"utf16_col":11}},"extent_utf16":{"start":{"line_number":382,"utf16_col":0},"end":{"line_number":429,"utf16_col":0}}},{"name":"`get`","kind":"section_3","ident_start":17810,"ident_end":17815,"extent_start":17806,"extent_end":18377,"fully_qualified_name":"`get`","ident_utf16":{"start":{"line_number":429,"utf16_col":4},"end":{"line_number":429,"utf16_col":9}},"extent_utf16":{"start":{"line_number":429,"utf16_col":0},"end":{"line_number":449,"utf16_col":0}}},{"name":"`post` and `requestDelete`","kind":"section_3","ident_start":18381,"ident_end":18407,"extent_start":18377,"extent_end":18557,"fully_qualified_name":"`post` and `requestDelete`","ident_utf16":{"start":{"line_number":449,"utf16_col":4},"end":{"line_number":449,"utf16_col":30}},"extent_utf16":{"start":{"line_number":449,"utf16_col":0},"end":{"line_number":454,"utf16_col":0}}},{"name":"`Connection`","kind":"section_3","ident_start":18561,"ident_end":18573,"extent_start":18557,"extent_end":19220,"fully_qualified_name":"`Connection`","ident_utf16":{"start":{"line_number":454,"utf16_col":4},"end":{"line_number":454,"utf16_col":16}},"extent_utf16":{"start":{"line_number":454,"utf16_col":0},"end":{"line_number":479,"utf16_col":0}}},{"name":"\u003ca name=\"processes\"\u003e\u003c/a\u003e Processes (aka Actors)","kind":"section_2","ident_start":19223,"ident_end":19270,"extent_start":19220,"extent_end":26496,"fully_qualified_name":"\u003ca name=\"processes\"\u003e\u003c/a\u003e Processes (aka Actors)","ident_utf16":{"start":{"line_number":479,"utf16_col":3},"end":{"line_number":479,"utf16_col":50}},"extent_utf16":{"start":{"line_number":479,"utf16_col":0},"end":{"line_number":707,"utf16_col":0}}},{"name":"Process Lifecycle","kind":"section_3","ident_start":19915,"ident_end":19932,"extent_start":19911,"extent_end":21685,"fully_qualified_name":"Process Lifecycle","ident_utf16":{"start":{"line_number":493,"utf16_col":4},"end":{"line_number":493,"utf16_col":21}},"extent_utf16":{"start":{"line_number":493,"utf16_col":0},"end":{"line_number":549,"utf16_col":0}}},{"name":"Memory Management","kind":"section_4","ident_start":20975,"ident_end":20992,"extent_start":20970,"extent_end":21685,"fully_qualified_name":"Memory Management","ident_utf16":{"start":{"line_number":527,"utf16_col":5},"end":{"line_number":527,"utf16_col":22}},"extent_utf16":{"start":{"line_number":527,"utf16_col":0},"end":{"line_number":549,"utf16_col":0}}},{"name":"Process Identity: `PID` and `UPID`","kind":"section_3","ident_start":21689,"ident_end":21723,"extent_start":21685,"extent_end":22574,"fully_qualified_name":"Process Identity: `PID` and `UPID`","ident_utf16":{"start":{"line_number":549,"utf16_col":4},"end":{"line_number":549,"utf16_col":38}},"extent_utf16":{"start":{"line_number":549,"utf16_col":0},"end":{"line_number":575,"utf16_col":0}}},{"name":"Process Event Queue (aka Mailbox)","kind":"section_3","ident_start":22578,"ident_end":22611,"extent_start":22574,"extent_end":25053,"fully_qualified_name":"Process Event Queue (aka Mailbox)","ident_utf16":{"start":{"line_number":575,"utf16_col":4},"end":{"line_number":575,"utf16_col":37}},"extent_utf16":{"start":{"line_number":575,"utf16_col":0},"end":{"line_number":661,"utf16_col":0}}},{"name":"`MessageEvent`","kind":"section_4","ident_start":23596,"ident_end":23610,"extent_start":23591,"extent_end":24942,"fully_qualified_name":"`MessageEvent`","ident_utf16":{"start":{"line_number":589,"utf16_col":5},"end":{"line_number":589,"utf16_col":19}},"extent_utf16":{"start":{"line_number":589,"utf16_col":0},"end":{"line_number":645,"utf16_col":0}}},{"name":"`DispatchEvent`","kind":"section_4","ident_start":24947,"ident_end":24962,"extent_start":24942,"extent_end":24971,"fully_qualified_name":"`DispatchEvent`","ident_utf16":{"start":{"line_number":645,"utf16_col":5},"end":{"line_number":645,"utf16_col":20}},"extent_utf16":{"start":{"line_number":645,"utf16_col":0},"end":{"line_number":649,"utf16_col":0}}},{"name":"`HttpEvent`","kind":"section_4","ident_start":24976,"ident_end":24987,"extent_start":24971,"extent_end":24996,"fully_qualified_name":"`HttpEvent`","ident_utf16":{"start":{"line_number":649,"utf16_col":5},"end":{"line_number":649,"utf16_col":16}},"extent_utf16":{"start":{"line_number":649,"utf16_col":0},"end":{"line_number":653,"utf16_col":0}}},{"name":"`ExitedEvent`","kind":"section_4","ident_start":25001,"ident_end":25014,"extent_start":24996,"extent_end":25023,"fully_qualified_name":"`ExitedEvent`","ident_utf16":{"start":{"line_number":653,"utf16_col":5},"end":{"line_number":653,"utf16_col":18}},"extent_utf16":{"start":{"line_number":653,"utf16_col":0},"end":{"line_number":657,"utf16_col":0}}},{"name":"`TerminateEvent`","kind":"section_4","ident_start":25028,"ident_end":25044,"extent_start":25023,"extent_end":25053,"fully_qualified_name":"`TerminateEvent`","ident_utf16":{"start":{"line_number":657,"utf16_col":5},"end":{"line_number":657,"utf16_col":21}},"extent_utf16":{"start":{"line_number":657,"utf16_col":0},"end":{"line_number":661,"utf16_col":0}}},{"name":"\u003ca name=\"async-pimpl\"\u003e\u003c/a\u003e Processes and the Asynchronous Pimpl Pattern","kind":"section_3","ident_start":25057,"ident_end":25128,"extent_start":25053,"extent_end":26496,"fully_qualified_name":"\u003ca name=\"async-pimpl\"\u003e\u003c/a\u003e Processes and the Asynchronous Pimpl Pattern","ident_utf16":{"start":{"line_number":661,"utf16_col":4},"end":{"line_number":661,"utf16_col":75}},"extent_utf16":{"start":{"line_number":661,"utf16_col":0},"end":{"line_number":707,"utf16_col":0}}},{"name":"\u003ca name=\"clock\"\u003e\u003c/a\u003e Clock Management and Timeouts","kind":"section_2","ident_start":26499,"ident_end":26549,"extent_start":26496,"extent_end":28273,"fully_qualified_name":"\u003ca name=\"clock\"\u003e\u003c/a\u003e Clock Management and Timeouts","ident_utf16":{"start":{"line_number":707,"utf16_col":3},"end":{"line_number":707,"utf16_col":53}},"extent_utf16":{"start":{"line_number":707,"utf16_col":0},"end":{"line_number":790,"utf16_col":0}}},{"name":"\u003ca name=\"miscellaneous-primitives\"\u003e\u003c/a\u003e Miscellaneous Primitives","kind":"section_2","ident_start":28276,"ident_end":28340,"extent_start":28273,"extent_end":28501,"fully_qualified_name":"\u003ca name=\"miscellaneous-primitives\"\u003e\u003c/a\u003e Miscellaneous Primitives","ident_utf16":{"start":{"line_number":790,"utf16_col":3},"end":{"line_number":790,"utf16_col":67}},"extent_utf16":{"start":{"line_number":790,"utf16_col":0},"end":{"line_number":798,"utf16_col":0}}},{"name":"`async`","kind":"section_3","ident_start":28346,"ident_end":28353,"extent_start":28342,"extent_end":28501,"fully_qualified_name":"`async`","ident_utf16":{"start":{"line_number":792,"utf16_col":4},"end":{"line_number":792,"utf16_col":11}},"extent_utf16":{"start":{"line_number":792,"utf16_col":0},"end":{"line_number":798,"utf16_col":0}}},{"name":"\u003ca name=\"optimized-run-queue-event-queue\"\u003e\u003c/a\u003e Optimized Run Queue and Event Queue","kind":"section_2","ident_start":28504,"ident_end":28586,"extent_start":28501,"extent_end":30302,"fully_qualified_name":"\u003ca name=\"optimized-run-queue-event-queue\"\u003e\u003c/a\u003e Optimized Run Queue and Event Queue","ident_utf16":{"start":{"line_number":798,"utf16_col":3},"end":{"line_number":798,"utf16_col":85}},"extent_utf16":{"start":{"line_number":798,"utf16_col":0},"end":{"line_number":837,"utf16_col":0}}},{"name":"Details","kind":"section_4","ident_start":29310,"ident_end":29317,"extent_start":29305,"extent_end":29950,"fully_qualified_name":"Details","ident_utf16":{"start":{"line_number":817,"utf16_col":5},"end":{"line_number":817,"utf16_col":12}},"extent_utf16":{"start":{"line_number":817,"utf16_col":0},"end":{"line_number":830,"utf16_col":0}}},{"name":"Benchmark","kind":"section_4","ident_start":29955,"ident_end":29964,"extent_start":29950,"extent_end":30302,"fully_qualified_name":"Benchmark","ident_utf16":{"start":{"line_number":830,"utf16_col":5},"end":{"line_number":830,"utf16_col":14}},"extent_utf16":{"start":{"line_number":830,"utf16_col":0},"end":{"line_number":837,"utf16_col":0}}}]}},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/apache/mesos/branches":{"post":"hmj3oP5qdcmvjDogPs3o7Ed4Oap6A40tOKMkpUBZ9DLnzkN4CN1pWx3HlRNdDMAX_OTqpgAcr3iGTYSvpYS0eg"},"/repos/preferences":{"post":"0_a9LLyLfzu6sjjHSIKrdS_JfrzAihtqDy5csV7NUXVSkGeltdGbPMNqr6C3rU0pHU6hvdwXh960jy08ovxTMg"}}},"title":"mesos/3rdparty/libprocess/README.md at master · apache/mesos","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-7d7eb7c71814.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-96e76d5fdb2c.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"overview_shared_code_dropdown_button":false,"react_blob_overlay":false,"accessible_code_button":true,"github_models_repo_integration":false}}}</script> <div data-target="react-app.reactRoot"><style data-styled="true" data-styled-version="5.3.11">.gISSDQ{width:100%;}/*!sc*/ @media screen and (min-width:544px){.gISSDQ{width:100%;}}/*!sc*/ @media screen and (min-width:768px){.gISSDQ{width:auto;}}/*!sc*/ .iHHOSp{min-width:0;display:none;}/*!sc*/ @media screen and (min-width:768px){.iHHOSp{height:100vh;max-height:100vh !important;}}/*!sc*/ @media print,screen and (max-width:1011px) and (min-width:768px){.iHHOSp{display:none;}}/*!sc*/ .bHLmSv{position:absolute;inset:0 -2px;cursor:col-resize;background-color:transparent;-webkit-transition-delay:0.1s;transition-delay:0.1s;}/*!sc*/ .bHLmSv:hover{background-color:var(--bgColor-neutral-muted,var(--color-neutral-muted,rgba(175,184,193,0.2)));}/*!sc*/ .gsfaIN{margin-right:auto;}/*!sc*/ @media print{.gsfaIN{display:-webkit-box !important;display:-webkit-flex !important;display:-ms-flexbox !important;display:flex !important;}}/*!sc*/ .leYMvG{margin-left:auto;margin-right:auto;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;padding-bottom:40px;max-width:100%;margin-top:0;}/*!sc*/ .KMPzq{display:inherit;}/*!sc*/ .hfKjHv{width:100%;}/*!sc*/ .gZWyZE{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:8px;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;width:100%;}/*!sc*/ .dwYKDk{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;gap:8px;}/*!sc*/ .ibcGmb{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;min-width:0;}/*!sc*/ .hKaEJF{display:block;margin-right:8px;}/*!sc*/ @media screen and (min-width:1360px){.hKaEJF{display:block;}}/*!sc*/ .XosP{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;font-size:14px;}/*!sc*/ .bCKfWo[data-size="medium"]{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));padding-left:8px;padding-right:8px;display:none;}/*!sc*/ @media screen and (max-width:768px){.bCKfWo[data-size="medium"]{display:block;}}/*!sc*/ .gUkoLg{-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}/*!sc*/ .dmxRgG[data-size="medium"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ .dmxRgG[data-size="medium"] svg{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .dmxRgG[data-size="medium"] > span{width:inherit;}/*!sc*/ .bZBlpz{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;}/*!sc*/ .lhTYNA{margin-right:4px;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .dbrgmi{font-size:14px;min-width:0;max-width:125px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}/*!sc*/ .bmcJak{min-width:0;}/*!sc*/ .dHJiml{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding-left:8px;padding-right:8px;min-width:0;}/*!sc*/ .cEytCf{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;font-size:16px;min-width:0;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;max-width:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}/*!sc*/ .fzFXnm{max-width:100%;}/*!sc*/ .iMnkmv{max-width:100%;list-style:none;display:inline-block;}/*!sc*/ .ghzDag{display:inline-block;max-width:100%;}/*!sc*/ .kHuKdh{font-weight:600;}/*!sc*/ .hzJBof{padding-left:4px;padding-right:4px;font-weight:400;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));font-size:16px;}/*!sc*/ .kgiVEz{font-weight:400;}/*!sc*/ .jGhzSQ{font-weight:600;display:inline-block;max-width:100%;font-size:16px;}/*!sc*/ .faNtbn{min-height:32px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;}/*!sc*/ .fmQaBv{margin-left:4px;margin-right:4px;}/*!sc*/ .vcvyP{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-width:160px;}/*!sc*/ .dwNhzn[data-size="medium"][data-no-visuals]{border-top-left-radius:0;border-bottom-left-radius:0;display:none;}/*!sc*/ .fGwBZA[data-size="medium"][data-no-visuals]{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .dJxjrT{margin-left:16px;margin-right:16px;}/*!sc*/ .eFxKDQ{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}/*!sc*/ .dzCJzi{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:8px;min-width:273px;padding:8px;}/*!sc*/ @media screen and (min-width:544px){.dzCJzi{-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;}}/*!sc*/ .ldRxiI{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}/*!sc*/ .fVkfyA{width:100%;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;min-width:0;margin-right:0;}/*!sc*/ .gNAmSV{height:40px;padding-left:4px;padding-bottom:16px;}/*!sc*/ .jNEwzY{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}/*!sc*/ .bsDwxw{font-size:12px;-webkit-flex:auto;-ms-flex:auto;flex:auto;padding-right:16px;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));min-width:0;}/*!sc*/ .jdLMhu{top:0px;z-index:4;background:var(--bgColor-default,var(--color-canvas-default));position:-webkit-sticky;position:sticky;}/*!sc*/ .tOISc{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;width:100%;position:absolute;}/*!sc*/ .hqwSEx{display:none;min-width:0;padding-top:8px;padding-bottom:8px;}/*!sc*/ .bDVoEr{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;overflow:hidden;margin-left:8px;margin-right:8px;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;width:100%;}/*!sc*/ .kYLlPM{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}/*!sc*/ .gYjEmn{margin-left:4px;margin-right:8px;}/*!sc*/ .kGqOLL{text-overflow:ellipsis;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ .fHind{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;font-size:14px;min-width:0;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;max-width:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}/*!sc*/ .oDtgN{padding-left:4px;padding-right:4px;font-weight:400;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));font-size:14px;}/*!sc*/ .dnZoUW{font-weight:600;display:inline-block;max-width:100%;font-size:14px;}/*!sc*/ .jRZWlf[data-size="small"]{color:var(--fgColor-default,var(--color-fg-default,#1F2328));margin-left:8px;}/*!sc*/ .kTvpNk{padding-left:8px;padding-top:8px;padding-bottom:8px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;background-color:var(--bgColor-muted,var(--color-canvas-subtle,#f6f8fa));border:1px solid var(--borderColor-default,var(--color-border-default));border-radius:6px 6px 0px 0px;}/*!sc*/ .iNMjfP{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:8px;min-width:0;}/*!sc*/ .gtTaSn{font-size:14px;}/*!sc*/ .dXYHoy{--separator-color:transparent;}/*!sc*/ .jBWIdY{--separator-color:var(--borderColor-default,var(--color-border-default,#d0d7de));}/*!sc*/ .kcLCKF{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:8px;margin-right:8px;}/*!sc*/ .kVWtTz{gap:8px;}/*!sc*/ .gWqxTd{padding-left:8px;padding-right:8px;}/*!sc*/ .gWqxTd linkButtonSx:hover:not([disabled]){-webkit-text-decoration:none;text-decoration:none;}/*!sc*/ .gWqxTd linkButtonSx:focus:not([disabled]){-webkit-text-decoration:none;text-decoration:none;}/*!sc*/ .gWqxTd linkButtonSx:active:not([disabled]){-webkit-text-decoration:none;text-decoration:none;}/*!sc*/ .ivobqY[data-size="small"][data-no-visuals]{border-top-left-radius:0;border-bottom-left-radius:0;}/*!sc*/ .iNRSob[data-size="small"][data-no-visuals]{color:var(--fgColor-muted,var(--color-fg-muted));margin-right:8px;}/*!sc*/ .ffkqe[data-size="small"][data-no-visuals]{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .hGyMdv{border:1px solid;border-top:none;border-color:var(--borderColor-default,var(--color-border-default,#d0d7de));border-radius:0px 0px 6px 6px;min-width:273px;}/*!sc*/ .fGqKFv{background-color:var(--bgColor-default,var(--color-canvas-default));border:0px;border-width:0;border-radius:0px 0px 6px 6px;padding:0;min-width:0;margin-top:46px;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}/*!sc*/ .eoaCFS{border-bottom-left-radius:6px;border-bottom-right-radius:6px;padding:32px;min-width:0;}/*!sc*/ .cCoXib{position:fixed;top:0;right:0;height:100%;width:15px;-webkit-transition:-webkit-transform 0.3s;-webkit-transition:transform 0.3s;transition:transform 0.3s;z-index:1;}/*!sc*/ .cCoXib:hover{-webkit-transform:scaleX(1.5);-ms-transform:scaleX(1.5);transform:scaleX(1.5);}/*!sc*/ data-styled.g1[id="Box-sc-g0xbh4-0"]{content:"gISSDQ,iHHOSp,bHLmSv,gsfaIN,leYMvG,KMPzq,hfKjHv,gZWyZE,dwYKDk,ibcGmb,hKaEJF,XosP,bCKfWo,gUkoLg,dmxRgG,bZBlpz,lhTYNA,dbrgmi,bmcJak,dHJiml,cEytCf,fzFXnm,iMnkmv,ghzDag,kHuKdh,hzJBof,kgiVEz,jGhzSQ,faNtbn,fmQaBv,vcvyP,dwNhzn,fGwBZA,dJxjrT,eFxKDQ,dzCJzi,ldRxiI,fVkfyA,gNAmSV,jNEwzY,bsDwxw,jdLMhu,tOISc,hqwSEx,bDVoEr,kYLlPM,gYjEmn,kGqOLL,fHind,oDtgN,dnZoUW,jRZWlf,kTvpNk,iNMjfP,gtTaSn,dXYHoy,jBWIdY,kcLCKF,kVWtTz,gWqxTd,ivobqY,iNRSob,ffkqe,hGyMdv,fGqKFv,eoaCFS,cCoXib,"}/*!sc*/ .hWlpPn{position:relative;display:inline-block;}/*!sc*/ .hWlpPn::after{position:absolute;z-index:1000000;display:none;padding:0.5em 0.75em;font:normal normal 11px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";-webkit-font-smoothing:subpixel-antialiased;color:var(--tooltip-fgColor,var(--fgColor-onEmphasis,var(--color-fg-on-emphasis,#ffffff)));text-align:center;-webkit-text-decoration:none;text-decoration:none;text-shadow:none;text-transform:none;-webkit-letter-spacing:normal;-moz-letter-spacing:normal;-ms-letter-spacing:normal;letter-spacing:normal;word-wrap:break-word;white-space:pre;pointer-events:none;content:attr(aria-label);background:var(--tooltip-bgColor,var(--bgColor-emphasis,var(--color-neutral-emphasis-plus,#24292f)));border-radius:6px;opacity:0;}/*!sc*/ @-webkit-keyframes tooltip-appear{from{opacity:0;}to{opacity:1;}}/*!sc*/ @keyframes tooltip-appear{from{opacity:0;}to{opacity:1;}}/*!sc*/ .hWlpPn:hover::after,.hWlpPn:active::after,.hWlpPn:focus::after,.hWlpPn:focus-within::after{display:inline-block;-webkit-text-decoration:none;text-decoration:none;-webkit-animation-name:tooltip-appear;animation-name:tooltip-appear;-webkit-animation-duration:0.1s;animation-duration:0.1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;-webkit-animation-delay:0s;animation-delay:0s;}/*!sc*/ .hWlpPn.tooltipped-no-delay:hover::after,.hWlpPn.tooltipped-no-delay:active::after,.hWlpPn.tooltipped-no-delay:focus::after,.hWlpPn.tooltipped-no-delay:focus-within::after{-webkit-animation-delay:0s;animation-delay:0s;}/*!sc*/ .hWlpPn.tooltipped-multiline:hover::after,.hWlpPn.tooltipped-multiline:active::after,.hWlpPn.tooltipped-multiline:focus::after,.hWlpPn.tooltipped-multiline:focus-within::after{display:table-cell;}/*!sc*/ .hWlpPn.tooltipped-s::after,.hWlpPn.tooltipped-se::after,.hWlpPn.tooltipped-sw::after{top:100%;right:50%;margin-top:6px;}/*!sc*/ .hWlpPn.tooltipped-se::after{right:auto;left:50%;margin-left:-16px;}/*!sc*/ .hWlpPn.tooltipped-sw::after{margin-right:-16px;}/*!sc*/ .hWlpPn.tooltipped-n::after,.hWlpPn.tooltipped-ne::after,.hWlpPn.tooltipped-nw::after{right:50%;bottom:100%;margin-bottom:6px;}/*!sc*/ .hWlpPn.tooltipped-ne::after{right:auto;left:50%;margin-left:-16px;}/*!sc*/ .hWlpPn.tooltipped-nw::after{margin-right:-16px;}/*!sc*/ .hWlpPn.tooltipped-s::after,.hWlpPn.tooltipped-n::after{-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);}/*!sc*/ .hWlpPn.tooltipped-w::after{right:100%;bottom:50%;margin-right:6px;-webkit-transform:translateY(50%);-ms-transform:translateY(50%);transform:translateY(50%);}/*!sc*/ .hWlpPn.tooltipped-e::after{bottom:50%;left:100%;margin-left:6px;-webkit-transform:translateY(50%);-ms-transform:translateY(50%);transform:translateY(50%);}/*!sc*/ .hWlpPn.tooltipped-multiline::after{width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:250px;word-wrap:break-word;white-space:pre-line;border-collapse:separate;}/*!sc*/ .hWlpPn.tooltipped-multiline.tooltipped-s::after,.hWlpPn.tooltipped-multiline.tooltipped-n::after{right:auto;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);}/*!sc*/ .hWlpPn.tooltipped-multiline.tooltipped-w::after,.hWlpPn.tooltipped-multiline.tooltipped-e::after{right:100%;}/*!sc*/ .hWlpPn.tooltipped-align-right-2::after{right:0;margin-right:0;}/*!sc*/ .hWlpPn.tooltipped-align-left-2::after{left:0;margin-left:0;}/*!sc*/ data-styled.g16[id="Tooltip__TooltipBase-sc-17tf59c-0"]{content:"hWlpPn,"}/*!sc*/ .eAtkQz{display:inline-block;overflow:hidden;text-overflow:ellipsis;vertical-align:top;white-space:nowrap;max-width:125px;max-width:100%;}/*!sc*/ data-styled.g18[id="Truncate__StyledTruncate-sc-23o1d2-0"]{content:"eAtkQz,"}/*!sc*/ </style><meta data-hydrostats="publish"/> <!-- --> <!-- --> <button hidden="" data-testid="header-permalink-button" data-hotkey-scope="read-only-cursor-text-area"></button><button hidden=""></button><div><div style="--sticky-pane-height:100vh;--spacing:var(--spacing-none)" class="Box-sc-g0xbh4-0 prc-PageLayout-PageLayoutRoot-1zlEO"><div class="Box-sc-g0xbh4-0 prc-PageLayout-PageLayoutWrapper-s2ao4" data-width="full"><div class="Box-sc-g0xbh4-0 prc-PageLayout-PageLayoutContent-jzDMn"><div tabindex="0" class="Box-sc-g0xbh4-0 gISSDQ"><div class="Box-sc-g0xbh4-0 iHHOSp prc-PageLayout-PaneWrapper-nGO0U" style="--offset-header:0px;--spacing-row:var(--spacing-none);--spacing-column:var(--spacing-none)" data-is-hidden="false" data-position="start" data-sticky="true"><div class="Box-sc-g0xbh4-0 prc-PageLayout-HorizontalDivider-CYLp5 prc-PageLayout-PaneHorizontalDivider-4exOb" data-variant="none" data-position="start" style="--spacing-divider:var(--spacing-none);--spacing:var(--spacing-none)"></div><div class="Box-sc-g0xbh4-0 prc-PageLayout-Pane-Vl5LI" data-resizable="true" style="--spacing:var(--spacing-none);--pane-min-width:256px;--pane-max-width:calc(100vw - var(--pane-max-width-diff));--pane-width-size:var(--pane-width-large);--pane-width:320px"></div><div class="Box-sc-g0xbh4-0 prc-PageLayout-VerticalDivider-4A4Qm prc-PageLayout-PaneVerticalDivider-1c9vy" data-variant="none" data-position="start" style="--spacing:var(--spacing-none)"><div role="slider" aria-label="Draggable pane splitter" aria-valuemin="0" aria-valuemax="0" aria-valuenow="0" aria-valuetext="Pane width 0 pixels" tabindex="0" class="Box-sc-g0xbh4-0 bHLmSv"></div></div></div></div><div class="Box-sc-g0xbh4-0 gsfaIN prc-PageLayout-ContentWrapper-b-QRo" data-is-hidden="false"><div class="Box-sc-g0xbh4-0"></div><div class="Box-sc-g0xbh4-0 prc-PageLayout-Content--F7-I" data-width="full" style="--spacing:var(--spacing-none)"><div data-selector="repos-split-pane-content" tabindex="0" class="Box-sc-g0xbh4-0 leYMvG"><div class="Box-sc-g0xbh4-0 KMPzq"><div class="Box-sc-g0xbh4-0 hfKjHv container"><div class="px-3 pt-3 pb-0" id="StickyHeader"><div class="Box-sc-g0xbh4-0 gZWyZE"><div class="Box-sc-g0xbh4-0 dwYKDk"><div class="Box-sc-g0xbh4-0 ibcGmb react-code-view-header-wrap--narrow"><div class="Box-sc-g0xbh4-0 hKaEJF"><h2 class="Box-sc-g0xbh4-0 XosP prc-Heading-Heading-6CmGO"><button style="--button-color:fg.muted" type="button" aria-label="Expand file tree" data-testid="expand-file-tree-button-mobile" class="Box-sc-g0xbh4-0 bCKfWo prc-Button-ButtonBase-c50BI" data-loading="false" data-size="medium" data-variant="invisible" aria-describedby=":Rld9lab:-loading-announcement"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-arrow-left" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M7.78 12.53a.75.75 0 0 1-1.06 0L2.47 8.28a.75.75 0 0 1 0-1.06l4.25-4.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L4.81 7h7.44a.75.75 0 0 1 0 1.5H4.81l2.97 2.97a.75.75 0 0 1 0 1.06Z"></path></svg></span><span data-component="text" class="prc-Button-Label-pTQ3x">Files</span></span></button><span role="tooltip" aria-label="Expand file tree" id="expand-button-file-tree-button" class="Tooltip__TooltipBase-sc-17tf59c-0 hWlpPn tooltipped-se"><button data-component="IconButton" type="button" data-testid="expand-file-tree-button" aria-controls="repos-file-tree" class="prc-Button-ButtonBase-c50BI position-relative ExpandFileTreeButton-module__expandButton--gL4is ExpandFileTreeButton-module__filesButtonBreakpoint--WfX9t fgColor-muted prc-Button-IconButton-szpyj" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="invisible" aria-describedby=":R35d9lab:-loading-announcement" aria-labelledby="expand-button-file-tree-button"><svg aria-hidden="true" focusable="false" class="octicon octicon-sidebar-collapse" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M6.823 7.823a.25.25 0 0 1 0 .354l-2.396 2.396A.25.25 0 0 1 4 10.396V5.604a.25.25 0 0 1 .427-.177Z"></path><path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25H9.5v-13H1.75a.25.25 0 0 0-.25.25ZM11 14.5h3.25a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H11Z"></path></svg></button></span><button hidden="" data-testid="" data-hotkey-scope="read-only-cursor-text-area"></button></h2></div><div class="react-code-view-header-mb--narrow mr-2"><button type="button" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-label="master branch" data-testid="anchor-button" class="Box-sc-g0xbh4-0 dmxRgG prc-Button-ButtonBase-c50BI ref-selector-class" data-loading="false" data-size="medium" data-variant="default" aria-describedby="branch-picker-repos-header-ref-selector-wide-loading-announcement" id="branch-picker-repos-header-ref-selector-wide"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg prc-Button-ButtonContent-HKbr-"><span data-component="text" class="prc-Button-Label-pTQ3x"><div class="Box-sc-g0xbh4-0 bZBlpz"><div class="Box-sc-g0xbh4-0 lhTYNA"><svg aria-hidden="true" focusable="false" class="octicon octicon-git-branch" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg></div><div class="Box-sc-g0xbh4-0 dbrgmi ref-selector-button-text-container"><span class="Box-sc-g0xbh4-0 bmcJak prc-Text-Text-0ima0"> <!-- -->master</span></div></div></span><span data-component="trailingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></span></span></button><button hidden="" data-hotkey-scope="read-only-cursor-text-area"></button></div><div class="Box-sc-g0xbh4-0 dHJiml react-code-view-header-mb--narrow"><div class="Box-sc-g0xbh4-0 cEytCf"><nav data-testid="breadcrumbs" aria-labelledby="repos-header-breadcrumb-heading" id="repos-header-breadcrumb" class="Box-sc-g0xbh4-0 fzFXnm"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone--vW4Cq prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading" id="repos-header-breadcrumb-heading">Breadcrumbs</h2><ol class="Box-sc-g0xbh4-0 iMnkmv"><li class="Box-sc-g0xbh4-0 ghzDag"><a class="Box-sc-g0xbh4-0 kHuKdh prc-Link-Link-85e08" sx="[object Object]" data-testid="breadcrumbs-repo-link" href="/apache/mesos/tree/master">mesos</a></li><li class="Box-sc-g0xbh4-0 ghzDag"><span class="Box-sc-g0xbh4-0 hzJBof prc-Text-Text-0ima0" aria-hidden="true">/</span><a class="Box-sc-g0xbh4-0 kgiVEz prc-Link-Link-85e08" sx="[object Object]" href="/apache/mesos/tree/master/3rdparty">3rdparty</a></li><li class="Box-sc-g0xbh4-0 ghzDag"><span class="Box-sc-g0xbh4-0 hzJBof prc-Text-Text-0ima0" aria-hidden="true">/</span><a class="Box-sc-g0xbh4-0 kgiVEz prc-Link-Link-85e08" sx="[object Object]" href="/apache/mesos/tree/master/3rdparty/libprocess">libprocess</a></li></ol></nav><div data-testid="breadcrumbs-filename" class="Box-sc-g0xbh4-0 ghzDag"><span class="Box-sc-g0xbh4-0 hzJBof prc-Text-Text-0ima0" aria-hidden="true">/</span><h1 class="Box-sc-g0xbh4-0 jGhzSQ prc-Heading-Heading-6CmGO" tabindex="-1" id="file-name-id">README.md</h1></div><button data-component="IconButton" type="button" class="prc-Button-ButtonBase-c50BI ml-2 prc-Button-IconButton-szpyj" data-loading="false" data-no-visuals="true" data-size="small" data-variant="invisible" aria-describedby=":Rftd9lab:-loading-announcement" aria-labelledby=":R1td9lab:"><svg aria-hidden="true" focusable="false" class="octicon octicon-copy" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg></button><span class="CopyToClipboardButton-module__tooltip--Dq1IB prc-TooltipV2-Tooltip-cYMVY" data-direction="nw" aria-label="Copy path" aria-hidden="true" id=":R1td9lab:">Copy path</span></div></div></div><div class="react-code-view-header-element--wide"><div class="Box-sc-g0xbh4-0 faNtbn"><div class="d-flex gap-2"> <div><div class="Box-sc-g0xbh4-0 fmQaBv"><span class="Box-sc-g0xbh4-0 vcvyP TextInput-wrapper prc-components-TextInputWrapper-i1ofR prc-components-TextInputBaseWrapper-ueK9q" data-leading-visual="true" data-trailing-visual="true" aria-busy="false"><span class="TextInput-icon" id=":Rb66d9lab:" aria-hidden="true"><svg aria-hidden="true" focusable="false" class="octicon octicon-search" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg></span><input type="text" aria-label="Go to file" role="combobox" aria-controls="file-results-list" aria-expanded="false" aria-haspopup="dialog" autoCorrect="off" spellcheck="false" placeholder="Go to file" aria-describedby=":Rb66d9lab: :Rb66d9labH1:" data-component="input" class="prc-components-Input-Ic-y8" value=""/><span class="TextInput-icon" id=":Rb66d9labH1:" aria-hidden="true"></span></span></div><button hidden="" data-testid="" data-hotkey-scope="read-only-cursor-text-area"></button><button hidden=""></button></div><button type="button" class="Box-sc-g0xbh4-0 dwNhzn prc-Button-ButtonBase-c50BI" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-describedby=":R5a6d9lab:-loading-announcement"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg prc-Button-ButtonContent-HKbr-"><span data-component="text" class="prc-Button-Label-pTQ3x">Blame</span></span></button><button hidden="" data-testid="" data-hotkey-scope="read-only-cursor-text-area"></button><button data-component="IconButton" type="button" aria-label="More file actions" title="More file actions" data-testid="more-file-actions-button-nav-menu-wide" aria-haspopup="true" aria-expanded="false" tabindex="0" class="Box-sc-g0xbh4-0 fGwBZA prc-Button-ButtonBase-c50BI js-blob-dropdown-click prc-Button-IconButton-szpyj" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-describedby=":R2a6d9lab:-loading-announcement" id=":R2a6d9lab:"><svg aria-hidden="true" focusable="false" class="octicon octicon-kebab-horizontal" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg></button> </div></div></div><div class="react-code-view-header-element--narrow"><div class="Box-sc-g0xbh4-0 faNtbn"><div class="d-flex gap-2"> <button type="button" class="Box-sc-g0xbh4-0 dwNhzn prc-Button-ButtonBase-c50BI" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-describedby=":R5a7d9lab:-loading-announcement"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg prc-Button-ButtonContent-HKbr-"><span data-component="text" class="prc-Button-Label-pTQ3x">Blame</span></span></button><button hidden="" data-testid="" data-hotkey-scope="read-only-cursor-text-area"></button><button data-component="IconButton" type="button" aria-label="More file actions" title="More file actions" data-testid="more-file-actions-button-nav-menu-narrow" aria-haspopup="true" aria-expanded="false" tabindex="0" class="Box-sc-g0xbh4-0 fGwBZA prc-Button-ButtonBase-c50BI js-blob-dropdown-click prc-Button-IconButton-szpyj" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-describedby=":R2a7d9lab:-loading-announcement" id=":R2a7d9lab:"><svg aria-hidden="true" focusable="false" class="octicon octicon-kebab-horizontal" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg></button> </div></div></div></div></div></div></div></div><div class="Box-sc-g0xbh4-0 dJxjrT react-code-view-bottom-padding"> <div class="Box-sc-g0xbh4-0 eFxKDQ"></div> <!-- --> <!-- --> </div><div class="Box-sc-g0xbh4-0 dJxjrT"> <!-- --> <!-- --> <button hidden="" data-testid="" data-hotkey-scope="read-only-cursor-text-area"></button><button hidden=""></button><div class="d-flex flex-column border rounded-2 mb-3 pl-1"><div class="Box-sc-g0xbh4-0 dzCJzi"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone--vW4Cq prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading">Latest commit</h2><div style="width:120px" class="Skeleton Skeleton--text" data-testid="loading"> </div><div class="d-flex flex-shrink-0 gap-2"><div data-testid="latest-commit-details" class="d-none d-sm-flex flex-items-center"></div><div class="d-flex gap-2"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone--vW4Cq prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading">History</h2><a href="/apache/mesos/commits/master/3rdparty/libprocess/README.md" class="prc-Button-ButtonBase-c50BI d-none d-lg-flex LinkButton-module__code-view-link-button--xvCGA flex-items-center fgColor-default" data-loading="false" data-size="small" data-variant="invisible" aria-describedby=":R5dlal9lab:-loading-announcement"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-history" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg></span><span data-component="text" class="prc-Button-Label-pTQ3x"><span class="fgColor-default">History</span></span></span></a><div class="d-sm-none"></div><div class="d-flex d-lg-none"><span role="tooltip" aria-label="History" id="history-icon-button-tooltip" class="Tooltip__TooltipBase-sc-17tf59c-0 hWlpPn tooltipped-n"><a href="/apache/mesos/commits/master/3rdparty/libprocess/README.md" class="prc-Button-ButtonBase-c50BI LinkButton-module__code-view-link-button--xvCGA flex-items-center fgColor-default" data-loading="false" data-size="small" data-variant="invisible" aria-describedby=":Rpdlal9lab:-loading-announcement history-icon-button-tooltip"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-history" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg></span></span></a></span></div></div></div></div></div><div class="Box-sc-g0xbh4-0 ldRxiI"><div class="Box-sc-g0xbh4-0 fVkfyA container"><div class="Box-sc-g0xbh4-0 gNAmSV react-code-size-details-banner"><div class="Box-sc-g0xbh4-0 jNEwzY react-code-size-details-banner"><div class="Box-sc-g0xbh4-0 bsDwxw text-mono"><div title="29.6 KB" data-testid="blob-size" class="Truncate__StyledTruncate-sc-23o1d2-0 eAtkQz"><span>837 lines (580 loc) · 29.6 KB</span></div></div></div></div><div class="Box-sc-g0xbh4-0 jdLMhu react-blob-view-header-sticky" id="repos-sticky-header"><div class="Box-sc-g0xbh4-0 tOISc"><div class="react-blob-sticky-header"><div class="Box-sc-g0xbh4-0 hqwSEx"><div class="Box-sc-g0xbh4-0 bDVoEr"><div class="Box-sc-g0xbh4-0 kYLlPM"><div class="Box-sc-g0xbh4-0 gYjEmn"><button type="button" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-label="master branch" data-testid="anchor-button" class="Box-sc-g0xbh4-0 dmxRgG prc-Button-ButtonBase-c50BI ref-selector-class" data-loading="false" data-size="medium" data-variant="default" aria-describedby="branch-picker-repos-header-ref-selector-loading-announcement" id="branch-picker-repos-header-ref-selector"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg prc-Button-ButtonContent-HKbr-"><span data-component="text" class="prc-Button-Label-pTQ3x"><div class="Box-sc-g0xbh4-0 bZBlpz"><div class="Box-sc-g0xbh4-0 lhTYNA"><svg aria-hidden="true" focusable="false" class="octicon octicon-git-branch" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg></div><div class="Box-sc-g0xbh4-0 dbrgmi ref-selector-button-text-container"><span class="Box-sc-g0xbh4-0 bmcJak prc-Text-Text-0ima0"> <!-- -->master</span></div></div></span><span data-component="trailingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></span></span></button><button hidden="" data-hotkey-scope="read-only-cursor-text-area"></button></div><div class="Box-sc-g0xbh4-0 kGqOLL"><div class="Box-sc-g0xbh4-0 fHind"><nav data-testid="breadcrumbs" aria-labelledby="sticky-breadcrumb-heading" id="sticky-breadcrumb" class="Box-sc-g0xbh4-0 fzFXnm"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone--vW4Cq prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading" id="sticky-breadcrumb-heading">Breadcrumbs</h2><ol class="Box-sc-g0xbh4-0 iMnkmv"><li class="Box-sc-g0xbh4-0 ghzDag"><a class="Box-sc-g0xbh4-0 kHuKdh prc-Link-Link-85e08" sx="[object Object]" data-testid="breadcrumbs-repo-link" href="/apache/mesos/tree/master">mesos</a></li><li class="Box-sc-g0xbh4-0 ghzDag"><span class="Box-sc-g0xbh4-0 oDtgN prc-Text-Text-0ima0" aria-hidden="true">/</span><a class="Box-sc-g0xbh4-0 kgiVEz prc-Link-Link-85e08" sx="[object Object]" href="/apache/mesos/tree/master/3rdparty">3rdparty</a></li><li class="Box-sc-g0xbh4-0 ghzDag"><span class="Box-sc-g0xbh4-0 oDtgN prc-Text-Text-0ima0" aria-hidden="true">/</span><a class="Box-sc-g0xbh4-0 kgiVEz prc-Link-Link-85e08" sx="[object Object]" href="/apache/mesos/tree/master/3rdparty/libprocess">libprocess</a></li></ol></nav><div data-testid="breadcrumbs-filename" class="Box-sc-g0xbh4-0 ghzDag"><span class="Box-sc-g0xbh4-0 oDtgN prc-Text-Text-0ima0" aria-hidden="true">/</span><h1 class="Box-sc-g0xbh4-0 dnZoUW prc-Heading-Heading-6CmGO" tabindex="-1" id="sticky-file-name-id">README.md</h1></div></div></div></div><button style="--button-color:fg.default" type="button" class="Box-sc-g0xbh4-0 jRZWlf prc-Button-ButtonBase-c50BI" data-loading="false" data-size="small" data-variant="invisible" aria-describedby=":Riptal9lab:-loading-announcement"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-arrow-up" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M3.47 7.78a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0l4.25 4.25a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018L9 4.81v7.44a.75.75 0 0 1-1.5 0V4.81L4.53 7.78a.75.75 0 0 1-1.06 0Z"></path></svg></span><span data-component="text" class="prc-Button-Label-pTQ3x">Top</span></span></button></div></div></div><div class="Box-sc-g0xbh4-0 kTvpNk"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone--vW4Cq prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading">File metadata and controls</h2><div class="Box-sc-g0xbh4-0 iNMjfP"><ul aria-label="File view" class="Box-sc-g0xbh4-0 gtTaSn prc-SegmentedControl-SegmentedControl-e7570" data-size="small"><li class="Box-sc-g0xbh4-0 dXYHoy prc-SegmentedControl-Item-7Aq6h" data-selected="true"><button aria-current="true" class="prc-SegmentedControl-Button-ojWXD" type="button"><span class="prc-SegmentedControl-Content-gnQ4n"><div class="Box-sc-g0xbh4-0 prc-SegmentedControl-Text-c5gSh" data-text="Preview">Preview</div></span></button></li><li class="Box-sc-g0xbh4-0 jBWIdY prc-SegmentedControl-Item-7Aq6h"><button aria-current="false" class="prc-SegmentedControl-Button-ojWXD" type="button"><span class="prc-SegmentedControl-Content-gnQ4n"><div class="Box-sc-g0xbh4-0 prc-SegmentedControl-Text-c5gSh" data-text="Code">Code</div></span></button></li><li class="Box-sc-g0xbh4-0 jBWIdY prc-SegmentedControl-Item-7Aq6h"><button aria-current="false" class="prc-SegmentedControl-Button-ojWXD" type="button"><span class="prc-SegmentedControl-Content-gnQ4n"><div class="Box-sc-g0xbh4-0 prc-SegmentedControl-Text-c5gSh" data-text="Blame">Blame</div></span></button></li></ul><button hidden="" data-testid="" data-hotkey-scope="read-only-cursor-text-area"></button><button hidden="" data-testid="" data-hotkey-scope="read-only-cursor-text-area"></button><button hidden="" data-testid="" data-hotkey-scope="read-only-cursor-text-area"></button><div class="Box-sc-g0xbh4-0 jNEwzY react-code-size-details-in-header"><div class="Box-sc-g0xbh4-0 bsDwxw text-mono"><div title="29.6 KB" data-testid="blob-size" class="Truncate__StyledTruncate-sc-23o1d2-0 eAtkQz"><span>837 lines (580 loc) · 29.6 KB</span></div></div></div></div><div class="Box-sc-g0xbh4-0 kcLCKF"><div class="Box-sc-g0xbh4-0 kVWtTz react-blob-header-edit-and-raw-actions"><div class="Box-sc-g0xbh4-0 prc-ButtonGroup-ButtonGroup-vcMeG"><div><a href="https://github.com/apache/mesos/raw/refs/heads/master/3rdparty/libprocess/README.md" data-testid="raw-button" class="Box-sc-g0xbh4-0 gWqxTd prc-Button-ButtonBase-c50BI" data-loading="false" data-no-visuals="true" data-size="small" data-variant="default" aria-describedby=":R5csptal9lab:-loading-announcement"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg prc-Button-ButtonContent-HKbr-"><span data-component="text" class="prc-Button-Label-pTQ3x">Raw</span></span></a></div><div><button data-component="IconButton" type="button" aria-label="Copy raw content" data-testid="copy-raw-button" class="prc-Button-ButtonBase-c50BI prc-Button-IconButton-szpyj" data-loading="false" data-no-visuals="true" data-size="small" data-variant="default" aria-describedby=":Rpcsptal9lab:-loading-announcement"><svg aria-hidden="true" focusable="false" class="octicon octicon-copy" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg></button></div><div><span role="tooltip" aria-label="Download raw file" id=":Rdcsptal9lab:" class="Tooltip__TooltipBase-sc-17tf59c-0 hWlpPn tooltipped-n"><button data-component="IconButton" type="button" aria-label="Download raw content" data-testid="download-raw-button" class="Box-sc-g0xbh4-0 ivobqY prc-Button-ButtonBase-c50BI prc-Button-IconButton-szpyj" data-loading="false" data-no-visuals="true" data-size="small" data-variant="default" aria-describedby=":Rtcsptal9lab:-loading-announcement"><svg aria-hidden="true" focusable="false" class="octicon octicon-download" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"></path><path d="M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z"></path></svg></button></span></div></div><button hidden="" data-testid="raw-button-shortcut" data-hotkey-scope="read-only-cursor-text-area"></button><button hidden="" data-testid="copy-raw-button-shortcut" data-hotkey-scope="read-only-cursor-text-area"></button><button hidden="" data-testid="download-raw-button-shortcut" data-hotkey-scope="read-only-cursor-text-area"></button></div><button data-component="IconButton" type="button" aria-label="Outline" aria-pressed="false" class="Box-sc-g0xbh4-0 iNRSob prc-Button-ButtonBase-c50BI prc-Button-IconButton-szpyj" data-loading="false" data-no-visuals="true" data-size="small" data-variant="invisible" aria-describedby=":R6sptal9lab:-loading-announcement"><svg aria-hidden="true" focusable="false" class="octicon octicon-list-unordered" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M5.75 2.5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5ZM2 14a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm1-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM2 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg></button><div class="react-blob-header-edit-and-raw-actions-combined"><button data-component="IconButton" type="button" aria-label="Edit and raw actions" title="More file actions" data-testid="more-file-actions-button" aria-haspopup="true" aria-expanded="false" tabindex="0" class="Box-sc-g0xbh4-0 ffkqe prc-Button-ButtonBase-c50BI js-blob-dropdown-click prc-Button-IconButton-szpyj" data-loading="false" data-no-visuals="true" data-size="small" data-variant="invisible" aria-describedby=":Rnsptal9lab:-loading-announcement" id=":Rnsptal9lab:"><svg aria-hidden="true" focusable="false" class="octicon octicon-kebab-horizontal" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg></button></div></div></div></div><div></div></div><div class="Box-sc-g0xbh4-0 hGyMdv"><section aria-labelledby="file-name-id-wide file-name-id-mobile" class="Box-sc-g0xbh4-0 fGqKFv"><div class="Box-sc-g0xbh4-0 eoaCFS js-snippet-clipboard-copy-unpositioned undefined" data-hpc="true"><article class="markdown-body entry-content container-lg" itemprop="text"><div class="markdown-heading" dir="auto"><h1 tabindex="-1" class="heading-element" dir="auto">Libprocess User Guide</h1><a id="user-content-libprocess-user-guide" class="anchor" aria-label="Permalink: Libprocess User Guide" href="#libprocess-user-guide"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">libprocess provides general primitives and abstractions for asynchronous programming with <a href="https://en.wikipedia.org/wiki/Futures_and_promises" rel="nofollow">futures/promises</a>, <a href="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol" rel="nofollow">HTTP</a>, and <a href="http://en.wikipedia.org/wiki/Actor_model" rel="nofollow">actors</a>.</p> <blockquote> <p dir="auto"><br> <strong>Inspired by <a href="http://erlang.org" rel="nofollow">Erlang</a>, libprocess gets it's name from calling an "actor" a "process" (not to be confused by an operating system process).</strong> <br><br></p> </blockquote> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Table of Contents</h2><a id="user-content-table-of-contents" class="anchor" aria-label="Permalink: Table of Contents" href="#table-of-contents"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul dir="auto"> <li><a href="#presentations">Presentations</a></li> <li><a href="#overview">Overview</a></li> <li><a href="#futures-and-promises">Futures and Promises</a></li> <li><a href="#http">HTTP</a></li> <li><a href="#processes">Processes (aka Actors)</a></li> <li><a href="#clock">Clock Management and Timeouts</a></li> <li><a href="#miscellaneous-primitives">Miscellaneous Primitives</a></li> <li><a href="#optimized-run-queue-event-queue">Optimized Run Queue and Event Queue</a></li> </ul> <hr> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-presentations"></a> Presentations</h2><a id="user-content--presentations" class="anchor" aria-label="Permalink: Presentations" href="#-presentations"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The following talks are recommended to get an overview of libprocess:</p> <ul dir="auto"> <li><a href="https://www.youtube.com/watch?v=KjqaZYP0T2U" rel="nofollow">libprocess, a concurrent and asynchronous programming library (San Francisco C++ Meetup)</a></li> </ul> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-overview"></a> Overview</h2><a id="user-content--overview" class="anchor" aria-label="Permalink: Overview" href="#-overview"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This user guide is meant to help understand the constructs within the libprocess library. The main constructs are:</p> <ol dir="auto"> <li><a href="#futures-and-promises">Futures and Promises</a> which are used to build ...</li> <li><a href="#http">HTTP</a> abstractions, which make the foundation for ...</li> <li><a href="#processes">Processes (aka Actors)</a>.</li> </ol> <p dir="auto">For most people processes (aka actors) are the most foreign of the concepts, but they are arguably the most critical part of the library (they library is named after them!). Nevertheless, we organized this guide to walk through futures/promises and HTTP before processes because the former two are prerequisites for the latter.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-futures-and-promises"></a> Futures and Promises</h2><a id="user-content--futures-and-promises" class="anchor" aria-label="Permalink: Futures and Promises" href="#-futures-and-promises"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The <code>Future</code> and <code>Promise</code> primitives are used to enable programmers to write asynchronous, non-blocking, and highly concurrent software.</p> <p dir="auto">A <code>Future</code> acts as the read-side of a result which might be computed asynchronously. A <code>Promise</code>, on the other hand, acts as the write-side "container".</p> <p dir="auto">Looking for a specific topic?</p> <ul dir="auto"> <li><a href="#futures-and-promises-basics">Basics</a></li> <li><a href="#futures-and-promises-states">States</a></li> <li><a href="#futures-and-promises-discarding-a-future">Disarding a Future (aka Cancellation)</a></li> <li><a href="#futures-and-promises-abandoned-futures">Abandoned Futures</a></li> <li><a href="#futures-and-promises-composition">Composition: <code>Future::then()</code>, <code>Future::repair()</code>, and <code>Future::recover()</code></a></li> <li><a href="#futures-and-promises-discarding-and-composition">Discarding and Composition</a></li> <li><a href="#futures-and-promises-callback-semantics">Callback Semantics</a></li> <li><a href="#futures-and-promises-check-overloads"><code>CHECK()</code> Overloads</a></li> </ul> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-futures-and-promises-basics"></a> Basics</h3><a id="user-content--basics" class="anchor" aria-label="Permalink: Basics" href="#-basics"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">A <code>Promise</code> is templated by the type that it will "contain". A <code>Promise</code> is not copyable or assignable in order to encourage strict ownership rules between processes (i.e., it's hard to reason about multiple actors concurrently trying to complete a <code>Promise</code>, even if it's safe to do so concurrently).</p> <p dir="auto">You can get a <code>Future</code> from a <code>Promise</code> using <code>Promise::future()</code>. Unlike <code>Promise</code>, a <code>Future</code> can be both copied and assigned.</p> <blockquote> <p dir="auto"><br> As of this time, the templated type of the future must be the exact same as the promise: you cannot create a covariant or contravariant future. <br><br></p> </blockquote> <p dir="auto">Here is a simple example of using <code>Promise</code> and <code>Future</code>:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::Future; using process::Promise; int main(int argc, char** argv) { Promise<int> promise; Future<int> future = promise.future(); // You can copy a future. Future<int> future2 = future; // You can also assign a future (NOTE: this future will never // complete because the Promise goes out of scope, but the // Future is still valid and can be used normally.) future = Promise<int>().future(); return 0; }"><pre><span class="pl-k">using</span> process::Future; <span class="pl-k">using</span> process::Promise; <span class="pl-k">int</span> <span class="pl-en">main</span>(<span class="pl-k">int</span> argc, <span class="pl-k">char</span>** argv) { Promise<<span class="pl-k">int</span>> promise; Future<<span class="pl-k">int</span>> future = promise.<span class="pl-c1">future</span>(); <span class="pl-c"><span class="pl-c">//</span> You can copy a future.</span> Future<<span class="pl-k">int</span>> future2 = future; <span class="pl-c"><span class="pl-c">//</span> You can also assign a future (NOTE: this future will never</span> <span class="pl-c"><span class="pl-c">//</span> complete because the Promise goes out of scope, but the</span> <span class="pl-c"><span class="pl-c">//</span> Future is still valid and can be used normally.)</span> future = Promise<<span class="pl-k">int</span>>().<span class="pl-c1">future</span>(); <span class="pl-k">return</span> <span class="pl-c1">0</span>; }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-futures-and-promises-states"></a> States</h3><a id="user-content--states" class="anchor" aria-label="Permalink: States" href="#-states"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">A promise starts in the <code>PENDING</code> state and can then transition to any of the <code>READY</code>, <code>FAILED</code>, or <code>DISCARDED</code> states. You can check the state using <code>Future::isPending()</code>, <code>Future::isReady()</code>, <code>Future::isFailed()</code>, and <code>Future::isDiscarded()</code>.</p> <blockquote> <p dir="auto"><br> We typically refer to transitioning to <code>READY</code> as <em>completing the promise/future</em>. <br><br></p> </blockquote> <p dir="auto">You can also add a callback to be invoked when (or if) a transition occurs (or has occcured) by using the <code>Future::onReady()</code>, <code>Future::onFailed()</code>, and <code>Future::onDiscarded()</code>. As a <em>catch all</em> you can use <code>Future::onAny()</code> which will invoke it's callbacks on a transition to all of <code>READY</code>, <code>FAILED</code>, and <code>DISCARDED</code>. <strong>See <a href="#futures-and-promises-callback-semantics">Callback Semantics</a> for a discussion of how/when these callbacks get invoked.</strong></p> <p dir="auto">The following table is meant to capture these transitions:</p> <markdown-accessiblity-table><table> <thead> <tr> <th>Transition</th> <th><code>Promise::*()</code></th> <th><code>Future::is*()</code></th> <th><code>Future::on*()</code></th> </tr> </thead> <tbody> <tr> <td><code>READY</code></td> <td><code>Promise::set(T)</code></td> <td><code>Future::isReady()</code></td> <td><code>Future::onReady(F&&)</code></td> </tr> <tr> <td><code>FAILED</code></td> <td><code>Promise::fail(const std::string&)</code></td> <td><code>Future::isFailed()</code></td> <td><code>Future::onFailed(F&&)</code></td> </tr> <tr> <td><code>DISCARDED</code></td> <td><code>Promise::discard()</code></td> <td><code>Future::isDiscarded()</code></td> <td><code>Future::onDiscarded(F&&)</code></td> </tr> </tbody> </table></markdown-accessiblity-table> <blockquote> <p dir="auto"><br> Code Style: prefer <a href="#futures-and-promises-composition">composition</a> using <code>Future::then()</code> and <code>Future::recover()</code> over <code>Future::onReady()</code>, <code>Future::onFailed()</code>, <code>Future::onDiscarded()</code>, and <code>Future::onAny()</code>. A good rule of thumb is if you find yourself creating your own instance of a <code>Promise</code> to compose an asynchronous operation you should use <a href="#futures-and-promises-composition">composition</a> instead! <br><br></p> </blockquote> <p dir="auto">We use the macros <code>CHECK_PENDING()</code>, <code>CHECK_READY()</code>, <code>CHECK_FAILED()</code>, <code>CHECK_DISCARDED()</code> throughout our examples. See <a href="#futures-and-promises-check-overloads"><code>CHECK()</code> Overloads</a> for more details about these macros.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-futures-and-promises-discarding-a-future"></a> Discarding a Future (aka Cancellation)</h3><a id="user-content--discarding-a-future-aka-cancellation" class="anchor" aria-label="Permalink: Discarding a Future (aka Cancellation)" href="#-discarding-a-future-aka-cancellation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">You can "cancel" the result of some asynchronous operation by discarding a future. Unlike doing a discard on a promise, <em>discarding a future is a request that may or may not be be satisfiable</em>. You discard a future using <code>Future::discard()</code>. You can determine if a future has a discard request by using <code>Future::hasDiscard()</code> or set up a callback using <code>Future::onDiscard()</code>. Here's an example:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::Future; using process::Promise; int main(int argc, char** argv) { Promise<int> promise; Future<int> future = promise.future(); CHECK_PENDING(future); future.discard(); CHECK(promise.future().hasDiscard()); CHECK_PENDING(future); // THE FUTURE IS STILL PENDING! return 0; }"><pre><span class="pl-k">using</span> process::Future; <span class="pl-k">using</span> process::Promise; <span class="pl-k">int</span> <span class="pl-en">main</span>(<span class="pl-k">int</span> argc, <span class="pl-k">char</span>** argv) { Promise<<span class="pl-k">int</span>> promise; Future<<span class="pl-k">int</span>> future = promise.<span class="pl-c1">future</span>(); <span class="pl-c1">CHECK_PENDING</span>(future); future.<span class="pl-c1">discard</span>(); <span class="pl-c1">CHECK</span>(promise.<span class="pl-c1">future</span>().<span class="pl-c1">hasDiscard</span>()); <span class="pl-c1">CHECK_PENDING</span>(future); <span class="pl-c"><span class="pl-c">//</span> THE FUTURE IS STILL PENDING!</span> <span class="pl-k">return</span> <span class="pl-c1">0</span>; }</pre></div> <p dir="auto">The provider of the future will often use <code>Future::onDiscard()</code> to watch for discard requests and try and act accordingly, for example:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::Future; using process::Promise; int main(int argc, char** argv) { Promise<int> promise; // Set up a callback to discard the future if // requested (this is not always possible!). promise.future().onDiscard([&]() { promise.discard(); }); Future<int> future = promise.future(); CHECK_PENDING(future); future.discard(); CHECK_DISCARDED(future); // NO LONGER PENDING! return 0; }"><pre><span class="pl-k">using</span> process::Future; <span class="pl-k">using</span> process::Promise; <span class="pl-k">int</span> <span class="pl-en">main</span>(<span class="pl-k">int</span> argc, <span class="pl-k">char</span>** argv) { Promise<<span class="pl-k">int</span>> promise; <span class="pl-c"><span class="pl-c">//</span> Set up a callback to discard the future if</span> <span class="pl-c"><span class="pl-c">//</span> requested (this is not always possible!).</span> promise.<span class="pl-c1">future</span>().<span class="pl-c1">onDiscard</span>([&]() { promise.<span class="pl-c1">discard</span>(); }); Future<<span class="pl-k">int</span>> future = promise.<span class="pl-c1">future</span>(); <span class="pl-c1">CHECK_PENDING</span>(future); future.<span class="pl-c1">discard</span>(); <span class="pl-c1">CHECK_DISCARDED</span>(future); <span class="pl-c"><span class="pl-c">//</span> NO LONGER PENDING!</span> <span class="pl-k">return</span> <span class="pl-c1">0</span>; }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-futures-and-promises-abandoned-futures"></a> Abandoned Futures</h3><a id="user-content--abandoned-futures" class="anchor" aria-label="Permalink: Abandoned Futures" href="#-abandoned-futures"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">An instance of <code>Promise</code> that is deleted before it has transitioned out of <code>PENDING</code> is considered abandoned. The concept of abandonment was added late to the library so for backwards compatibility reasons we could not add a new state but instead needed to have it be a sub-state of <code>PENDING</code>.</p> <p dir="auto">You can check if a future has been abandoned by doing <code>Future::isAbandoned()</code> and set up a callback using <code>Future::onAbandoned()</code>. Here's an example:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::Future; using process::Promise; int main(int argc, char** argv) { Promise<int>* promise = new Promise<int>(); Future<int> future = promise->future(); CHECK(!future.isAbandoned()); delete promise; // ABANDONMENT! CHECK_ABANDONED(future); CHECK_PENDING(future); // ALSO STILL PENDING! return 0; }"><pre><span class="pl-k">using</span> process::Future; <span class="pl-k">using</span> process::Promise; <span class="pl-k">int</span> <span class="pl-en">main</span>(<span class="pl-k">int</span> argc, <span class="pl-k">char</span>** argv) { Promise<<span class="pl-k">int</span>>* promise = <span class="pl-k">new</span> Promise<<span class="pl-k">int</span>>(); Future<<span class="pl-k">int</span>> future = promise-><span class="pl-c1">future</span>(); <span class="pl-c1">CHECK</span>(!future.<span class="pl-c1">isAbandoned</span>()); <span class="pl-k">delete</span> promise; <span class="pl-c"><span class="pl-c">//</span> ABANDONMENT!</span> <span class="pl-c1">CHECK_ABANDONED</span>(future); <span class="pl-c1">CHECK_PENDING</span>(future); <span class="pl-c"><span class="pl-c">//</span> ALSO STILL PENDING!</span> <span class="pl-k">return</span> <span class="pl-c1">0</span>; }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-futures-and-promises-composition"></a> Composition: <code>Future::then()</code>, <code>Future::repair()</code>, and <code>Future::recover()</code></h3><a id="user-content--composition-futurethen-futurerepair-and-futurerecover" class="anchor" aria-label="Permalink: Composition: Future::then(), Future::repair(), and Future::recover()" href="#-composition-futurethen-futurerepair-and-futurerecover"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">You can compose together asynchronous function calls using <code>Future::then()</code>, <code>Future::repair()</code>, and <code>Future::recover()</code>. To help understand the value of composition, we'll start with an example of how you might manually do this composition:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::Future; using process::Promise; // Returns an instance of `Person` for the specified `name`. Future<Person> find(const std::string& name); // Returns the mother (an instance of `Person`) of the specified `name`. Future<Person> mother(const std::string& name) { // First find the person. Future<Person> person = find(name); // Now create a `Promise` that we can use to compose the two asynchronous calls. Promise<Person>* promise = new Promise<Person>(); Future<Person> mother = promise->future(); // Here is the boiler plate that can be replaced by `Future::then()`! person.onAny([](const Future<Person>& person) { if (person.isFailed()) { promise->fail(person.failure()); } else if (person.isDiscarded()) { promise->discard(); } else { CHECK_READY(person); promise->set(find(person->mother)); } delete promise; }); return mother; }"><pre><span class="pl-k">using</span> process::Future; <span class="pl-k">using</span> process::Promise; <span class="pl-c"><span class="pl-c">//</span> Returns an instance of `Person` for the specified `name`.</span> Future<Person> <span class="pl-en">find</span>(<span class="pl-k">const</span> std::string& name); <span class="pl-c"><span class="pl-c">//</span> Returns the mother (an instance of `Person`) of the specified `name`.</span> Future<Person> <span class="pl-en">mother</span>(<span class="pl-k">const</span> std::string& name) { <span class="pl-c"><span class="pl-c">//</span> First find the person.</span> Future<Person> person = <span class="pl-c1">find</span>(name); <span class="pl-c"><span class="pl-c">//</span> Now create a `Promise` that we can use to compose the two asynchronous calls.</span> Promise<Person>* promise = <span class="pl-k">new</span> Promise<Person>(); Future<Person> mother = promise-><span class="pl-c1">future</span>(); <span class="pl-c"><span class="pl-c">//</span> Here is the boiler plate that can be replaced by `Future::then()`!</span> person.<span class="pl-c1">onAny</span>([](<span class="pl-k">const</span> Future<Person>& person) { <span class="pl-k">if</span> (person.<span class="pl-c1">isFailed</span>()) { promise-><span class="pl-c1">fail</span>(person.<span class="pl-c1">failure</span>()); } <span class="pl-k">else</span> <span class="pl-k">if</span> (person.<span class="pl-c1">isDiscarded</span>()) { promise-><span class="pl-c1">discard</span>(); } <span class="pl-k">else</span> { <span class="pl-c1">CHECK_READY</span>(person); promise-><span class="pl-c1">set</span>(<span class="pl-c1">find</span>(person-><span class="pl-smi">mother</span>)); } <span class="pl-k">delete</span> promise; }); <span class="pl-k">return</span> mother; }</pre></div> <p dir="auto">Using <code>Future::then()</code> this can be simplified to:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::Future; // Returns an instance of `Person` for the specified `name`. Future<Person> find(const std::string& name); // Returns the mother (an instance of `Person`) of the specified `name`. Future<Person> mother(const std::string& name) { return find(name) .then([](const Person& person) { return find(person.mother); }); }"><pre><span class="pl-k">using</span> process::Future; <span class="pl-c"><span class="pl-c">//</span> Returns an instance of `Person` for the specified `name`.</span> Future<Person> <span class="pl-en">find</span>(<span class="pl-k">const</span> std::string& name); <span class="pl-c"><span class="pl-c">//</span> Returns the mother (an instance of `Person`) of the specified `name`.</span> Future<Person> <span class="pl-en">mother</span>(<span class="pl-k">const</span> std::string& name) { <span class="pl-k">return</span> <span class="pl-c1">find</span>(name) .<span class="pl-c1">then</span>([](<span class="pl-k">const</span> Person& person) { <span class="pl-k">return</span> <span class="pl-c1">find</span>(person.<span class="pl-smi">mother</span>); }); }</pre></div> <p dir="auto">Each of <code>Future::then()</code>, <code>Future::repair()</code>, and <code>Future::recover()</code> takes a callback that will be invoked after certain transitions, captured by this table:</p> <markdown-accessiblity-table><table> <thead> <tr> <th>Transition</th> <th><code>Future::*()</code></th> </tr> </thead> <tbody> <tr> <td><code>READY</code></td> <td><code>Future::then(F&&)</code></td> </tr> <tr> <td><code>FAILED</code></td> <td><code>Future::repair(F&&)</code> and <code>Future::recover(F&&)</code></td> </tr> <tr> <td><code>DISCARDED</code></td> <td><code>Future::recover(F&&)</code></td> </tr> <tr> <td>Abandoned (<code>PENDING</code> and <code>Future::isAbandoned()</code>)</td> <td><code>Future::recover(F&&)</code></td> </tr> </tbody> </table></markdown-accessiblity-table> <p dir="auto"><code>Future::then()</code> allows you to <em>transform</em> the type of the <code>Future</code> into a new type but both <code>Future::repair()</code> and <code>Future::recover()</code> must return the same type as <code>Future</code> because they may not get executed! Here's an example using <code>Future::recover()</code> to handle a failure:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::Future; // Returns an instance of `Person` for the specified `name`. Future<Person> find(const std::string& name); // Returns a parent (an instance of `Person`) of the specified `name`. Future<Person> parent(const std::string& name) { return find(name) .then([](const Person& person) { // Try to find the mother and if that fails try the father! return find(person.mother) .recover([=](const Future<Person>&) { return find(person.father); }); }); }"><pre><span class="pl-k">using</span> process::Future; <span class="pl-c"><span class="pl-c">//</span> Returns an instance of `Person` for the specified `name`.</span> Future<Person> <span class="pl-en">find</span>(<span class="pl-k">const</span> std::string& name); <span class="pl-c"><span class="pl-c">//</span> Returns a parent (an instance of `Person`) of the specified `name`.</span> Future<Person> <span class="pl-en">parent</span>(<span class="pl-k">const</span> std::string& name) { <span class="pl-k">return</span> <span class="pl-c1">find</span>(name) .<span class="pl-c1">then</span>([](<span class="pl-k">const</span> Person& person) { <span class="pl-c"><span class="pl-c">//</span> Try to find the mother and if that fails try the father!</span> <span class="pl-k">return</span> <span class="pl-c1">find</span>(person.<span class="pl-smi">mother</span>) .<span class="pl-c1">recover</span>([=](<span class="pl-k">const</span> Future<Person>&) { <span class="pl-k">return</span> <span class="pl-c1">find</span>(person.<span class="pl-smi">father</span>); }); }); }</pre></div> <blockquote> <p dir="auto"><br> <strong>Be careful what you capture in your callbacks! Depending on the state of the future the callback may be executed from a different scope and what ever you captured may no longer be valid; see <a href="#futures-and-promises-callback-semantics">Callback Semantics</a> for more details.</strong> <br><br></p> </blockquote> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-futures-and-promises-discarding-and-composition"></a> Discarding and Composition</h3><a id="user-content--discarding-and-composition" class="anchor" aria-label="Permalink: Discarding and Composition" href="#-discarding-and-composition"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Doing a <code>Future::discard()</code> will <em>propagate</em> through each of the futures composed with <code>Future::then()</code>, <code>Future::recover()</code>, etc. This is usually what you want, but there are two important caveats to look out for:</p> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-futures-and-promises-then-discards"></a> 1. <code>Future::then()</code> enforces discards</h4><a id="user-content--1-futurethen-enforces-discards" class="anchor" aria-label="Permalink: 1. Future::then() enforces discards" href="#-1-futurethen-enforces-discards"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The future returned by <code>Future::then()</code> <em>will not execute the callback if a discard has been requested.</em> That is, even if the future transitions to <code>READY</code>, <code>Future::then()</code> will still enforce the request to discard and transition the future to <code>DISCARDED</code>.</p> <blockquote> <p dir="auto"><br> These semantics are surprising to many, and, admittedly, the library may at one point in the future change the semantics and introduce a <code>discardable()</code> helper for letting people explicitly decide if/when they want a callback to be discarded. Historically, these semantics were chosen so that people could write infinite loops using <code>Future::then()</code> that could be interrupted with <code>Future::discard()</code>. The proper way to do infinte loops today is with <code>loop()</code>. <br><br></p> </blockquote> <p dir="auto">Here's an example to clarify this caveat:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::Future; using process::Promise; int main(int argc, char** argv) { Promise<int> promise; Future<std::string> future = promise.future() .then([](int i) { return stringify(i); }); future.discard(); CHECK_PENDING(future); promise.set(42); CHECK_DISCARDED(future); // EVEN THOUGH THE PROMISE COMPLETED SUCCESSFULLY! return 0; }"><pre><span class="pl-k">using</span> process::Future; <span class="pl-k">using</span> process::Promise; <span class="pl-k">int</span> <span class="pl-en">main</span>(<span class="pl-k">int</span> argc, <span class="pl-k">char</span>** argv) { Promise<<span class="pl-k">int</span>> promise; Future<std::string> future = promise.<span class="pl-c1">future</span>() .<span class="pl-c1">then</span>([](<span class="pl-k">int</span> i) { <span class="pl-k">return</span> <span class="pl-c1">stringify</span>(i); }); future.<span class="pl-c1">discard</span>(); <span class="pl-c1">CHECK_PENDING</span>(future); promise.<span class="pl-c1">set</span>(<span class="pl-c1">42</span>); <span class="pl-c1">CHECK_DISCARDED</span>(future); <span class="pl-c"><span class="pl-c">//</span> EVEN THOUGH THE PROMISE COMPLETED SUCCESSFULLY!</span> <span class="pl-k">return</span> <span class="pl-c1">0</span>; }</pre></div> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-futures-and-promises-undiscardable"></a> 2. Sometimes you want something to be <code>undiscardable()</code></h4><a id="user-content--2-sometimes-you-want-something-to-be-undiscardable" class="anchor" aria-label="Permalink: 2. Sometimes you want something to be undiscardable()" href="#-2-sometimes-you-want-something-to-be-undiscardable"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">You may find yourself in a circumstance when you're referencing (or composing) futures but <em>you don't want a disard to propagate to the referenced future!</em> Consider some code that needs to complete some expensive initialization before other functions can be called. We can model that by composing each function with the initialization, for example:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::Future; Future<T> foo() { return initialization .then([](...) { return ...; }); }"><pre><span class="pl-k">using</span> process::Future; Future<T> <span class="pl-en">foo</span>() { <span class="pl-k">return</span> initialization .<span class="pl-c1">then</span>([](...) { <span class="pl-k">return</span> ...; }); }</pre></div> <p dir="auto">In the above example, if someone were to discard the future returned from <code>foo()</code> <em>they would also end up discarding the initialization!</em></p> <p dir="auto">The real intention here is to compose with the initialization but not propagate discarding. This can be accomplished using <code>undiscardable()</code> which acts as a barrier to stop a discard from propagating through. Here's how the previous example would look with <code>undiscardable()</code>:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::Future; using process::undiscardable; Future<T> foo() { return undiscardable(initialization) .then([](...) { return ...; }); }"><pre><span class="pl-k">using</span> process::Future; <span class="pl-k">using</span> process::undiscardable; Future<T> <span class="pl-en">foo</span>() { <span class="pl-k">return</span> <span class="pl-c1">undiscardable</span>(initialization) .<span class="pl-c1">then</span>([](...) { <span class="pl-k">return</span> ...; }); }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-futures-and-promises-callback-semantics"></a> Callback Semantics</h3><a id="user-content--callback-semantics" class="anchor" aria-label="Permalink: Callback Semantics" href="#-callback-semantics"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">There are two possible ways in which the callbacks to the <code>Future::onReady()</code> family of functions as well as the composition functions like <code>Future::then()</code> get invoked:</p> <ol dir="auto"> <li>By the caller of <code>Future::onReady()</code>, <code>Future::then()</code>, etc.</li> <li>By the caller of <code>Promise::set()</code>, <code>Promise::fail()</code>, etc.</li> </ol> <p dir="auto">The first case occurs if the future is already transitioned to that state when adding the callback, i.e., if the state is already <code>READY</code> for either <code>Future::onReady()</code> or <code>Future::then()</code>, or <code>FAILED</code> for <code>Future::onFailed()</code> or <code>Future::recover()</code>, etc, then the callback will be executed immediately.</p> <p dir="auto">The second case occurs if the future has not yet transitioned to that state. In that case the callback is stored and it is executed by the caller of <code>Promise::set()</code>, <code>Promise::fail()</code>, whoever is deleting the promise (for abandonment), etc.</p> <p dir="auto"><em>This means that it is critical to consider the synchronization that might be necessary for your code given that multiple possible callers could execute the callback!</em></p> <p dir="auto">We call these callback semantics <em>synchronous</em>, as opposed to <em>asynchronous</em>. You can use <code>defer()</code> in order to <em>asynchronously</em> invoke your callbacks.</p> <blockquote> <p dir="auto"><br> Note that after the callbacks are invoked they are deleted, so any resources that you might be holding on to inside the callback will properly be released after the future transitions and it's callbacks are invoked. <br><br></p> </blockquote> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-futures-and-promises-check-overloads"></a> <code>CHECK()</code> Overloads</h3><a id="user-content--check-overloads" class="anchor" aria-label="Permalink: CHECK() Overloads" href="#-check-overloads"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><code>CHECK()</code> is a macro from <a href="https://github.com/google/googletest">Google Test</a> which acts like an <code>assert</code> but prints a stack trace and does better signal management. In addition to <code>CHECK()</code>, we've also created wrapper macros <code>CHECK_PENDING()</code>, <code>CHECK_READY()</code>, <code>CHECK_FAILED()</code>, <code>CHECK_DISCARDED()</code> which enables you to more concisely do things like <code>CHECK_READY(future)</code> in your tests.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-http"></a> HTTP</h2><a id="user-content--http" class="anchor" aria-label="Permalink: HTTP" href="#-http"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">libprocess provides facilities for communicating between actors via HTTP messages. With the advent of the HTTP API, HTTP is becoming the preferred mode of communication.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><code>route</code></h3><a id="user-content-route" class="anchor" aria-label="Permalink: route" href="#route"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><code>route</code> installs an HTTP endpoint onto a process. Let's define a simple process that installs an endpoint upon initialization:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using namespace process; using namespace process::http; class HttpProcess : public Process<HttpProcess> { protected: void initialize() override { route("/testing", None(), [](const Request& request) { return testing(request.query); }); } }; class Http { public: Http() : process(new HttpProcess()) { spawn(process.get()); } virtual ~Http() { terminate(process.get()); wait(process.get()); } Owned<HttpProcess> process; };"><pre><span class="pl-k">using</span> <span class="pl-k">namespace</span> <span class="pl-en">process</span><span class="pl-k">;</span> <span class="pl-k">using</span> <span class="pl-k">namespace</span> <span class="pl-en">process</span>::http<span class="pl-k">;</span> <span class="pl-k">class</span> <span class="pl-en">HttpProcess</span> : <span class="pl-k">public</span> <span class="pl-en">Process</span><HttpProcess> { <span class="pl-k">protected:</span> <span class="pl-k">void</span> <span class="pl-en">initialize</span>() <span class="pl-k">override</span> { <span class="pl-c1">route</span>(<span class="pl-s"><span class="pl-pds">"</span>/testing<span class="pl-pds">"</span></span>, <span class="pl-c1">None</span>(), [](<span class="pl-k">const</span> Request& request) { <span class="pl-k">return</span> <span class="pl-c1">testing</span>(request.<span class="pl-smi">query</span>); }); } }; <span class="pl-k">class</span> <span class="pl-en">Http</span> { <span class="pl-k">public:</span> <span class="pl-en">Http</span>() : process(<span class="pl-k">new</span> HttpProcess()) { <span class="pl-c1">spawn</span>(process.<span class="pl-c1">get</span>()); } <span class="pl-k">virtual</span> <span class="pl-en">~Http</span>() { <span class="pl-c1">terminate</span>(process.<span class="pl-c1">get</span>()); <span class="pl-c1">wait</span>(process.<span class="pl-c1">get</span>()); } Owned<HttpProcess> process; };</pre></div> <p dir="auto">Now if our program instantiates this class, we can do something like: <code>$ curl localhost:1234/testing?value=42</code></p> <p dir="auto">Note that the port at which this endpoint can be reached is the port libprocess has bound to, which is determined by the <code>LIBPROCESS_PORT</code> environment variable. In the case of the Mesos master or agent, this environment variable is set according to the <code>--port</code> command-line flag.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><code>get</code></h3><a id="user-content-get" class="anchor" aria-label="Permalink: get" href="#get"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><code>get</code> will hit an HTTP endpoint with a GET request and return a <code>Future</code> containing the response. We can pass it either a libprocess <code>UPID</code> or a <code>URL</code>. Here's an example hitting the endpoint assuming we have a <code>UPID</code> named <code>upid</code>:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Future<Response> future = get(upid, "testing");"><pre>Future<Response> future = get(upid, <span class="pl-s"><span class="pl-pds">"</span>testing<span class="pl-pds">"</span></span>);</pre></div> <p dir="auto">Or let's assume our serving process has been set up on a remote server and we want to hit its endpoint. We'll construct a <code>URL</code> for the address and then call <code>get</code>:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="URL url = URL("http", "hostname", 1234, "/testing"); Future<Response> future = get(url);"><pre>URL url = URL(<span class="pl-s"><span class="pl-pds">"</span>http<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>hostname<span class="pl-pds">"</span></span>, <span class="pl-c1">1234</span>, <span class="pl-s"><span class="pl-pds">"</span>/testing<span class="pl-pds">"</span></span>); Future<Response> future = get(url);</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><code>post</code> and <code>requestDelete</code></h3><a id="user-content-post-and-requestdelete" class="anchor" aria-label="Permalink: post and requestDelete" href="#post-and-requestdelete"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The <code>post</code> and <code>requestDelete</code> functions will similarly send POST and DELETE requests to an HTTP endpoint. Their invocation is analogous to <code>get</code>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><code>Connection</code></h3><a id="user-content-connection" class="anchor" aria-label="Permalink: Connection" href="#connection"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">A <code>Connection</code> represents a connection to an HTTP server. <code>connect</code> can be used to connect to a server, and returns a <code>Future</code> containing the <code>Connection</code>. Let's open a connection to a server and send some requests:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Future<Connection> connect = connect(url); connect.await(); Connection connection = connect.get(); Request request; request.method = "GET"; request.url = url; request.body = "Amazing prose goes here."; request.keepAlive = true; Future<Response> response = connection.send(request);"><pre>Future<Connection> connect = connect(url); connect.await(); Connection connection = connect.get(); Request request; request.method = <span class="pl-s"><span class="pl-pds">"</span>GET<span class="pl-pds">"</span></span>; request.url = url; request.body = <span class="pl-s"><span class="pl-pds">"</span>Amazing prose goes here.<span class="pl-pds">"</span></span>; request.keepAlive = <span class="pl-c1">true</span>; Future<Response> response = connection.send(request);</pre></div> <p dir="auto">It's also worth noting that if multiple requests are sent in succession on a <code>Connection</code>, they will be automatically pipelined.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-processes"></a> Processes (aka Actors)</h2><a id="user-content--processes-aka-actors" class="anchor" aria-label="Permalink: Processes (aka Actors)" href="#-processes-aka-actors"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">An actor in libprocess is called a <em>process</em> (not to be confused by an operating system process).</p> <p dir="auto">A process receives events that it processes one at a time. Because a process is only processing one event at a time there's no need for synchronization within the process.</p> <p dir="auto">There are a few ways to create an event for a process, the most important including:</p> <ul dir="auto"> <li>You can <code>send()</code> a process a message.</li> <li>You can do a function <code>dispatch()</code> on a process.</li> <li>You can send an <code>http::Request</code> to a process.</li> </ul> <p dir="auto">That last one is exceptionally powerful; every process is also an HTTP-based service that you can communicate with using the HTTP protocol.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Process Lifecycle</h3><a id="user-content-process-lifecycle" class="anchor" aria-label="Permalink: Process Lifecycle" href="#process-lifecycle"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">You create a process like any other class in C++ but extending from <code>Process</code>. <code>Process</code> uses the <a href="http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern" rel="nofollow">curiously recurring template pattern (CRTP)</a> to simplify types for some of it's methods (you'll see this with <code>Process::self()</code> below).</p> <p dir="auto">Practically you can think of a process as a combination of a thread and an object, except creating/spawning a process is very cheap (no actual thread gets created, and no stack gets allocated).</p> <p dir="auto">Here's the simplest process you can create:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::Process; class FooProcess : public Process<FooProcess> {};"><pre><span class="pl-k">using</span> process::Process; <span class="pl-k">class</span> <span class="pl-en">FooProcess</span> : <span class="pl-k">public</span> <span class="pl-en">Process</span><FooProcess> {};</pre></div> <p dir="auto">You start a process using <code>spawn()</code>, stop a process using <code>terminate()</code>, and wait for it to terminate by using <code>wait()</code>:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::Process; using process::spawn; using process::terminate; using process::wait; class FooProcess : public Process<FooProcess> {}; int main(int argc, char** argv) { FooProcess process; spawn(process); terminate(process); wait(process); return 0; }"><pre><span class="pl-k">using</span> process::Process; <span class="pl-k">using</span> process::spawn; <span class="pl-k">using</span> process::terminate; <span class="pl-k">using</span> process::wait; <span class="pl-k">class</span> <span class="pl-en">FooProcess</span> : <span class="pl-k">public</span> <span class="pl-en">Process</span><FooProcess> {}; <span class="pl-k">int</span> <span class="pl-en">main</span>(<span class="pl-k">int</span> argc, <span class="pl-k">char</span>** argv) { FooProcess process; <span class="pl-c1">spawn</span>(process); <span class="pl-c1">terminate</span>(process); <span class="pl-c1">wait</span>(process); <span class="pl-k">return</span> <span class="pl-c1">0</span>; }</pre></div> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">Memory Management</h4><a id="user-content-memory-management" class="anchor" aria-label="Permalink: Memory Management" href="#memory-management"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">A process <em><strong>CAN NOT</strong></em> be deleted until after doing a <code>wait()</code>, otherwise you might release resources that the library is still using! To simplify memory management you can ask the library to delete the process for you after it has completely terminated. You do this by invoking <code>spawn()</code> and passing <code>true</code> as the second argument:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::Process; using process::spawn; using process::terminate; using process::wait; class FooProcess : public Process<FooProcess> {}; int main(int argc, char** argv) { FooProcess* process = new FooProcess(); spawn(process, true); // <-- `process` will be automatically deleted! terminate(process); wait(process) return 0; }"><pre><span class="pl-k">using</span> process::Process; <span class="pl-k">using</span> process::spawn; <span class="pl-k">using</span> process::terminate; <span class="pl-k">using</span> process::wait; <span class="pl-k">class</span> <span class="pl-en">FooProcess</span> : <span class="pl-k">public</span> <span class="pl-en">Process</span><FooProcess> {}; <span class="pl-k">int</span> <span class="pl-en">main</span>(<span class="pl-k">int</span> argc, <span class="pl-k">char</span>** argv) { FooProcess* process = <span class="pl-k">new</span> <span class="pl-c1">FooProcess</span>(); <span class="pl-c1">spawn</span>(process, <span class="pl-c1">true</span>); <span class="pl-c"><span class="pl-c">//</span> <-- `process` will be automatically deleted!</span> <span class="pl-c1">terminate</span>(process); <span class="pl-c1">wait</span>(process) <span class="pl-k">return</span> <span class="pl-c1">0</span>; }</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Process Identity: <code>PID</code> and <code>UPID</code></h3><a id="user-content-process-identity-pid-and-upid" class="anchor" aria-label="Permalink: Process Identity: PID and UPID" href="#process-identity-pid-and-upid"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">A process is uniquely identifiable by it's process id which can be any arbitrary string (but only one process can be spawned at a time with the same id). The <code>PID</code> and <code>UPID</code> types encapsulate both the process id as well as the network address for the process, e.g., the IP and port where the process can be reached if libprocess was initialized with an IPv4 or IPv6 network address. You can get the <code>PID</code> of a process by calling it's <code>self()</code> method:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::PID; using process::Process; using process::spawn; class FooProcess : public Process<FooProcess> {}; int main(int argc, char** argv) { FooProcess process; spawn(process); PID<FooProcess> pid = process.self(); return 0; }"><pre><span class="pl-k">using</span> process::PID; <span class="pl-k">using</span> process::Process; <span class="pl-k">using</span> process::spawn; <span class="pl-k">class</span> <span class="pl-en">FooProcess</span> : <span class="pl-k">public</span> <span class="pl-en">Process</span><FooProcess> {}; <span class="pl-k">int</span> <span class="pl-en">main</span>(<span class="pl-k">int</span> argc, <span class="pl-k">char</span>** argv) { FooProcess process; <span class="pl-c1">spawn</span>(process); PID<FooProcess> pid = process.<span class="pl-c1">self</span>(); <span class="pl-k">return</span> <span class="pl-c1">0</span>; }</pre></div> <p dir="auto">A <code>UPID</code> is the "<strong>u</strong>ntyped" base class of <code>PID</code>.</p> <blockquote> <p dir="auto">If you turn on logging you might see a <code>PID</code>/<code>UPID</code> printed out as <code>id@ip:port</code>.</p> </blockquote> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Process Event Queue (aka Mailbox)</h3><a id="user-content-process-event-queue-aka-mailbox" class="anchor" aria-label="Permalink: Process Event Queue (aka Mailbox)" href="#process-event-queue-aka-mailbox"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Each process has a queue of incoming <code>Event</code>'s that it processes one at a time. Other actor implementations often call this queue the "mailbox".</p> <p dir="auto">There are 5 different kinds of events that can be enqueued for a process:</p> <ul dir="auto"> <li><code>MessageEvent</code>: a <code>Message</code> has been received.</li> <li><code>DispatchEvent</code>: a method on the process has been "dispatched".</li> <li><code>HttpEvent</code>: an <code>http::Request</code> has been received.</li> <li><code>ExitedEvent</code>: another process which has been <a href="#links">linked</a> has terminated.</li> <li><code>TerminateEvent</code>: the process has been requested to terminate.</li> </ul> <p dir="auto">An event is serviced one at a time by invoking the process' <code>serve()</code> method which by default invokes the process' <code>visit()</code> method corresponding to the underlying event type. Most actors don't need to override the implementation of <code>serve()</code> or <code>visit()</code> but can rely on higher-level abstractions that simplify serving the event (e.g., <code>route()</code>, which make it easy to set up handlers for an <code>HttpEvent</code>, discussed below in <a href="#http">HTTP</a>).</p> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto"><code>MessageEvent</code></h4><a id="user-content-messageevent" class="anchor" aria-label="Permalink: MessageEvent" href="#messageevent"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">A <code>MessageEvent</code> gets enqueued for a process when it gets sent a <code>Message</code>, either locally or remotely. You use <code>send()</code> to send a message from within a process and <code>post()</code> to send a message from outside a process. A <code>post()</code> sends a message without a return address because there is no process to reply to. Here's a classic ping pong example using <code>send()</code>:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using process::MessageEvent; using process::PID; using process::Process; using process::spawn; using process::terminate; using process::wait; class ClientProcess : public Process<ClientProcess> { public: ClientProcess(const UPID& server) : server(server) {} void initialize() override { send(server, "ping"); } void visit(const MessageEvent& event) override { if (event.message.from == server && event.message.name == "pong") { terminate(self()); } } }; class ServerProcess : public Process<ServerProcess> { public: protected: void visit(const MessageEvent& event) override { if (event.message.name == "ping") { send(event.message.from, "pong"); } terminate(self()); } }; int main(int argc, char** argv) { PID<ServerProcess> server = spawn(new ServerProcess(), true); PID<ClientProcess> client = spawn(new ClientProcess(server), true); wait(server); wait(client); return 0; }"><pre><span class="pl-k">using</span> process::MessageEvent; <span class="pl-k">using</span> process::PID; <span class="pl-k">using</span> process::Process; <span class="pl-k">using</span> process::spawn; <span class="pl-k">using</span> process::terminate; <span class="pl-k">using</span> process::wait; <span class="pl-k">class</span> <span class="pl-en">ClientProcess</span> : <span class="pl-k">public</span> <span class="pl-en">Process</span><ClientProcess> { <span class="pl-k">public:</span> <span class="pl-en">ClientProcess</span>(<span class="pl-k">const</span> UPID& server) : server(server) {} <span class="pl-k">void</span> <span class="pl-en">initialize</span>() <span class="pl-k">override</span> { <span class="pl-c1">send</span>(server, <span class="pl-s"><span class="pl-pds">"</span>ping<span class="pl-pds">"</span></span>); } <span class="pl-k">void</span> <span class="pl-en">visit</span>(<span class="pl-k">const</span> MessageEvent& event) <span class="pl-k">override</span> { <span class="pl-k">if</span> (event.<span class="pl-smi">message</span>.<span class="pl-smi">from</span> == server && event.<span class="pl-smi">message</span>.<span class="pl-smi">name</span> == <span class="pl-s"><span class="pl-pds">"</span>pong<span class="pl-pds">"</span></span>) { <span class="pl-c1">terminate</span>(<span class="pl-c1">self</span>()); } } }; <span class="pl-k">class</span> <span class="pl-en">ServerProcess</span> : <span class="pl-k">public</span> <span class="pl-en">Process</span><ServerProcess> { <span class="pl-k">public:</span> <span class="pl-k">protected:</span> <span class="pl-k">void</span> <span class="pl-en">visit</span>(<span class="pl-k">const</span> MessageEvent& event) <span class="pl-k">override</span> { <span class="pl-k">if</span> (event.<span class="pl-smi">message</span>.<span class="pl-smi">name</span> == <span class="pl-s"><span class="pl-pds">"</span>ping<span class="pl-pds">"</span></span>) { <span class="pl-c1">send</span>(event.<span class="pl-smi">message</span>.<span class="pl-smi">from</span>, <span class="pl-s"><span class="pl-pds">"</span>pong<span class="pl-pds">"</span></span>); } <span class="pl-c1">terminate</span>(<span class="pl-c1">self</span>()); } }; <span class="pl-k">int</span> <span class="pl-en">main</span>(<span class="pl-k">int</span> argc, <span class="pl-k">char</span>** argv) { PID<ServerProcess> server = <span class="pl-c1">spawn</span>(<span class="pl-k">new</span> <span class="pl-c1">ServerProcess</span>(), <span class="pl-c1">true</span>); PID<ClientProcess> client = <span class="pl-c1">spawn</span>(<span class="pl-k">new</span> <span class="pl-c1">ClientProcess</span>(server), <span class="pl-c1">true</span>); <span class="pl-c1">wait</span>(server); <span class="pl-c1">wait</span>(client); <span class="pl-k">return</span> <span class="pl-c1">0</span>; }</pre></div> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto"><code>DispatchEvent</code></h4><a id="user-content-dispatchevent" class="anchor" aria-label="Permalink: DispatchEvent" href="#dispatchevent"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">TODO.</p> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto"><code>HttpEvent</code></h4><a id="user-content-httpevent" class="anchor" aria-label="Permalink: HttpEvent" href="#httpevent"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">TODO.</p> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto"><code>ExitedEvent</code></h4><a id="user-content-exitedevent" class="anchor" aria-label="Permalink: ExitedEvent" href="#exitedevent"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">TODO.</p> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto"><code>TerminateEvent</code></h4><a id="user-content-terminateevent" class="anchor" aria-label="Permalink: TerminateEvent" href="#terminateevent"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">TODO.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-async-pimpl"></a> Processes and the Asynchronous Pimpl Pattern</h3><a id="user-content--processes-and-the-asynchronous-pimpl-pattern" class="anchor" aria-label="Permalink: Processes and the Asynchronous Pimpl Pattern" href="#-processes-and-the-asynchronous-pimpl-pattern"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">It's tedious to require everyone to have to explicitly <code>spawn()</code>, <code>terminate()</code>, and <code>wait()</code> for a process. Having everyone call <code>dispatch()</code> when they really just want to invoke a function (albeit asynchronously) is unfortnate too! To alleviate these burdenes, a common pattern that is used is to wrap a process within another class that performs the <code>spawn()</code>, <code>terminate()</code>, <code>wait()</code>, and <code>dispatch()</code>'s for you. Here's a typical example:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class FooProcess : public Process<FooProcess> { public: void foo(int i); }; class Foo { public: Foo() { process::spawn(process); } ~Foo() { process::terminate(process); process::wait(process); } void foo(int i) { dispatch(process, &FooProcess::foo, i); } private: FooProcess process; }; int main(int argc, char** argv) { Foo foo; foo.foo(42); return 0; }"><pre><span class="pl-k">class</span> <span class="pl-en">FooProcess</span> : <span class="pl-k">public</span> <span class="pl-en">Process</span><FooProcess> { <span class="pl-k">public:</span> <span class="pl-k">void</span> <span class="pl-en">foo</span>(<span class="pl-k">int</span> i); }; <span class="pl-k">class</span> <span class="pl-en">Foo</span> { <span class="pl-k">public:</span> <span class="pl-en">Foo</span>() { <span class="pl-c1">process::spawn</span>(process); } <span class="pl-en">~Foo</span>() { <span class="pl-c1">process::terminate</span>(process); <span class="pl-c1">process::wait</span>(process); } <span class="pl-k">void</span> <span class="pl-en">foo</span>(<span class="pl-k">int</span> i) { <span class="pl-c1">dispatch</span>(process, &FooProcess::foo, i); } <span class="pl-k">private:</span> FooProcess process; }; <span class="pl-k">int</span> <span class="pl-en">main</span>(<span class="pl-k">int</span> argc, <span class="pl-k">char</span>** argv) { Foo foo; foo.<span class="pl-c1">foo</span>(<span class="pl-c1">42</span>); <span class="pl-k">return</span> <span class="pl-c1">0</span>; }</pre></div> <p dir="auto">Anyone using <code>Foo</code> uses it similarly to how they would work with any other <em>synchronous</em> object where they don't know, or need to know, the implementation details under the covers (i.e., that it's implemented using a process). This is similar to the <a href="https://en.wikipedia.org/wiki/Opaque_pointer" rel="nofollow">Pimpl</a> pattern, except we need to <code>spawn()</code> and <code>terminate()/wait()</code> and rather than <em>synchronously</em> invoking the underlying object we're <em>asynchronously</em> invoking the underlying object using <code>dispatch()</code>.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-clock"></a> Clock Management and Timeouts</h2><a id="user-content--clock-management-and-timeouts" class="anchor" aria-label="Permalink: Clock Management and Timeouts" href="#-clock-management-and-timeouts"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Asynchronous programs often use timeouts, e.g., because a process that initiates an asynchronous operation wants to take action if the operation hasn't completed within a certain time bound. To facilitate this, libprocess provides a set of abstractions that simplify writing timeout logic. Importantly, test code has the ability to manipulate the clock, in order to ensure that timeout logic is exercised (without needing to block the test program until the appropriate amount of system time has elapsed).</p> <p dir="auto">To invoke a function after a certain amount of time has elapsed, use <code>delay</code>:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using namespace process; class DelayedProcess : public Process<DelayedProcess> { public: void action(const string& name) { LOG(INFO) << "hello, " << name; promise.set(Nothing()); } Promise<Nothing> promise; }; int main() { DelayedProcess process; spawn(process); LOG(INFO) << "Starting to wait"; delay(Seconds(5), process.self(), &DelayedProcess::action, "Neil"); AWAIT_READY(process.promise.future()); LOG(INFO) << "Done waiting"; terminate(process); wait(process); return 0; }"><pre><span class="pl-k">using</span> <span class="pl-k">namespace</span> <span class="pl-en">process</span><span class="pl-k">;</span> <span class="pl-k">class</span> <span class="pl-en">DelayedProcess</span> : <span class="pl-k">public</span> <span class="pl-en">Process</span><DelayedProcess> { <span class="pl-k">public:</span> <span class="pl-k">void</span> <span class="pl-en">action</span>(<span class="pl-k">const</span> string& name) { <span class="pl-c1">LOG</span>(INFO) << <span class="pl-s"><span class="pl-pds">"</span>hello, <span class="pl-pds">"</span></span> << name; promise.<span class="pl-c1">set</span>(<span class="pl-c1">Nothing</span>()); } Promise<Nothing> promise; }; <span class="pl-k">int</span> <span class="pl-en">main</span>() { DelayedProcess process; <span class="pl-c1">spawn</span>(process); <span class="pl-c1">LOG</span>(INFO) << <span class="pl-s"><span class="pl-pds">"</span>Starting to wait<span class="pl-pds">"</span></span>; <span class="pl-c1">delay</span>(<span class="pl-c1">Seconds</span>(<span class="pl-c1">5</span>), process.<span class="pl-c1">self</span>(), &DelayedProcess::action, <span class="pl-s"><span class="pl-pds">"</span>Neil<span class="pl-pds">"</span></span>); <span class="pl-c1">AWAIT_READY</span>(process.<span class="pl-smi">promise</span>.<span class="pl-c1">future</span>()); <span class="pl-c1">LOG</span>(INFO) << <span class="pl-s"><span class="pl-pds">"</span>Done waiting<span class="pl-pds">"</span></span>; <span class="pl-c1">terminate</span>(process); <span class="pl-c1">wait</span>(process); <span class="pl-k">return</span> <span class="pl-c1">0</span>; }</pre></div> <p dir="auto">This invokes the <code>action</code> function after (at least) five seconds of time have elapsed. When writing unit tests for this code, blocking the test for five seconds is undesirable. To avoid this, we can use <code>Clock::advance</code>:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" int main() { DelayedProcess process; spawn(process); LOG(INFO) << "Starting to wait"; Clock::pause(); delay(Seconds(5), process.self(), &DelayedProcess::action, "Neil"); Clock::advance(Seconds(5)); AWAIT_READY(process.promise.future()); LOG(INFO) << "Done waiting"; terminate(process); wait(process); Clock::resume(); return 0; }"><pre><span class="pl-k">int</span> <span class="pl-en">main</span>() { DelayedProcess process; <span class="pl-c1">spawn</span>(process); <span class="pl-c1">LOG</span>(INFO) << <span class="pl-s"><span class="pl-pds">"</span>Starting to wait<span class="pl-pds">"</span></span>; <span class="pl-c1">Clock::pause</span>(); <span class="pl-c1">delay</span>(<span class="pl-c1">Seconds</span>(<span class="pl-c1">5</span>), process.<span class="pl-c1">self</span>(), &DelayedProcess::action, <span class="pl-s"><span class="pl-pds">"</span>Neil<span class="pl-pds">"</span></span>); <span class="pl-c1">Clock::advance</span>(<span class="pl-c1">Seconds</span>(<span class="pl-c1">5</span>)); <span class="pl-c1">AWAIT_READY</span>(process.<span class="pl-smi">promise</span>.<span class="pl-c1">future</span>()); <span class="pl-c1">LOG</span>(INFO) << <span class="pl-s"><span class="pl-pds">"</span>Done waiting<span class="pl-pds">"</span></span>; <span class="pl-c1">terminate</span>(process); <span class="pl-c1">wait</span>(process); <span class="pl-c1">Clock::resume</span>(); <span class="pl-k">return</span> <span class="pl-c1">0</span>; }</pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-miscellaneous-primitives"></a> Miscellaneous Primitives</h2><a id="user-content--miscellaneous-primitives" class="anchor" aria-label="Permalink: Miscellaneous Primitives" href="#-miscellaneous-primitives"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto"><code>async</code></h3><a id="user-content-async" class="anchor" aria-label="Permalink: async" href="#async"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Async defines a function template for asynchronously executing function closures. It provides their results as <a href="#futures-and-promises">futures</a>.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto"><a name="user-content-optimized-run-queue-event-queue"></a> Optimized Run Queue and Event Queue</h2><a id="user-content--optimized-run-queue-and-event-queue" class="anchor" aria-label="Permalink: Optimized Run Queue and Event Queue" href="#-optimized-run-queue-and-event-queue"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">There are a handful of compile-time optimizations that can be configured to improve the run queue and event queue performance. These are currently not enabled by default as they are considered <em><strong>alpha</strong></em>. These optimizations include:</p> <ul dir="auto"> <li> <p dir="auto"><code>--enable-lock-free-run-queue</code> (autotools) or <code>-DENABLE_LOCK_FREE_RUN_QUEUE</code> (cmake) which enables the lock-free run queue implementation.</p> </li> <li> <p dir="auto"><code>--enable-lock-free-event-queue</code> (autotools) or <code>-DENABLE_LOCK_FREE_EVENT_QUEUE</code> (cmake) which enables the lock-free event queue implementation.</p> </li> <li> <p dir="auto"><code>--enable-last-in-first-out-fixed-size-semaphore</code> (autotools) or <code>-DENABLE_LAST_IN_FIRST_OUT_FIXED_SIZE_SEMAPHORE</code> (cmake) which enables an optimized semaphore implementation.</p> </li> </ul> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">Details</h4><a id="user-content-details" class="anchor" aria-label="Permalink: Details" href="#details"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Both the lock-free run queue implementation and the lock-free event queue implementation use <code>moodycamel::ConcurrentQueue</code> which can be found <a href="https://github.com/cameron314/concurrentqueue">here</a>.</p> <p dir="auto">For the run queue we use a semaphore to block threads when there are not any processes to run. On Linux we found that using a semaphore from glibc (i.e., <code>sem_create</code>, <code>sem_wait</code>, <code>sem_post</code>, etc) had some performance issues. We discuss those performance issues and how our optimized semaphore overcomes them in more detail in <a href="https://github.com/apache/mesos/blob/master/3rdparty/libprocess/src/semaphore.hpp#L191">semaphore.hpp</a>.</p> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">Benchmark</h4><a id="user-content-benchmark" class="anchor" aria-label="Permalink: Benchmark" href="#benchmark"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The benchmark that we've used to drive the run queue and event queue performance improvements can be found in <a href="https://github.com/apache/mesos/blob/master/3rdparty/libprocess/src/tests/benchmarks.cpp#L426">benchmarks.cpp</a>. You can run the benchmark yourself by invoking <code>./benchmarks --gtest_filter=ProcessTest.*ThroughputPerformance</code>.</p> </article></div><button hidden=""></button></section></div></div></div> <!-- --> <!-- --> </div></div></div><div class="Box-sc-g0xbh4-0"></div></div></div></div></div><div id="find-result-marks-container" class="Box-sc-g0xbh4-0 cCoXib"></div><button hidden="" data-testid="" data-hotkey-scope="read-only-cursor-text-area"></button><button hidden=""></button></div> <!-- --> <!-- --> <script type="application/json" id="__PRIMER_DATA_:R0:__">{"resolvedServerColorMode":"day"}</script></div> </react-app> </turbo-frame> </div> </turbo-frame> </main> </div> </div> <footer class="footer pt-8 pb-6 f6 color-fg-muted p-responsive" role="contentinfo" > <h2 class='sr-only'>Footer</h2> <div class="d-flex flex-justify-center flex-items-center flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap"> <div class="d-flex flex-items-center flex-shrink-0 mx-2"> <a aria-label="Homepage" title="GitHub" class="footer-octicon mr-2" href="https://github.com"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"></path> </svg> </a> <span> © 2025 GitHub, Inc. </span> </div> <nav aria-label="Footer"> <h3 class="sr-only" id="sr-footer-heading">Footer navigation</h3> <ul class="list-style-none d-flex flex-justify-center flex-wrap mb-2 mb-lg-0" aria-labelledby="sr-footer-heading"> <li class="mx-2"> <a data-analytics-event="{"category":"Footer","action":"go to Terms","label":"text:terms"}" href="https://docs.github.com/site-policy/github-terms/github-terms-of-service" data-view-component="true" class="Link--secondary Link">Terms</a> </li> <li class="mx-2"> <a data-analytics-event="{"category":"Footer","action":"go to privacy","label":"text:privacy"}" href="https://docs.github.com/site-policy/privacy-policies/github-privacy-statement" data-view-component="true" class="Link--secondary Link">Privacy</a> </li> <li class="mx-2"> <a data-analytics-event="{"category":"Footer","action":"go to security","label":"text:security"}" href="https://github.com/security" data-view-component="true" class="Link--secondary Link">Security</a> </li> <li class="mx-2"> <a data-analytics-event="{"category":"Footer","action":"go to status","label":"text:status"}" href="https://www.githubstatus.com/" data-view-component="true" class="Link--secondary Link">Status</a> </li> <li class="mx-2"> <a data-analytics-event="{"category":"Footer","action":"go to docs","label":"text:docs"}" href="https://docs.github.com/" data-view-component="true" class="Link--secondary Link">Docs</a> </li> <li class="mx-2"> <a data-analytics-event="{"category":"Footer","action":"go to contact","label":"text:contact"}" href="https://support.github.com?tags=dotcom-footer" data-view-component="true" class="Link--secondary Link">Contact</a> </li> <li class="mx-2" > <cookie-consent-link> <button type="button" class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent" data-action="click:cookie-consent-link#showConsentManagement" data-analytics-event="{"location":"footer","action":"cookies","context":"subfooter","tag":"link","label":"cookies_link_subfooter_footer"}" > Manage cookies </button> </cookie-consent-link> </li> <li class="mx-2"> <cookie-consent-link> <button type="button" class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent" data-action="click:cookie-consent-link#showConsentManagement" data-analytics-event="{"location":"footer","action":"dont_share_info","context":"subfooter","tag":"link","label":"dont_share_info_link_subfooter_footer"}" > Do not share my personal information </button> </cookie-consent-link> </li> </ul> </nav> </div> </footer> <ghcc-consent id="ghcc" class="position-fixed bottom-0 left-0" style="z-index: 999999" data-initial-cookie-consent-allowed="" data-cookie-consent-required="false"></ghcc-consent> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> You can’t perform that action at this time. </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details> </template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div> </div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> <template id="snippet-clipboard-copy-button-unpositioned"> <div class="zeroclipboard-container"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> </div> <div id="js-global-screen-reader-notice" class="sr-only mt-n1" aria-live="polite" aria-atomic="true" ></div> <div id="js-global-screen-reader-notice-assertive" class="sr-only mt-n1" aria-live="assertive" aria-atomic="true"></div> </body> </html>