Change circuit-breaker status to half-open waiting. First request is invoked after half-open.

@param {Object} item
@param {Context} ctx
550805
function halfOpenWait(item, ctx) {
		item.state = C.CIRCUIT_HALF_OPEN_WAIT;
		item.ep.state = false;

		// Anti-stick protection
		item.cbTimer = setTimeout(() => halfOpen(item, ctx), item.opts.halfOpenTime);
		item.cbTimer.unref();
	}
370539
function afterHighlightedItemChange(e) {
        if (e.target.isMenu) {
            var el = this.el, menuItem = e.newVal;
            el.setAttribute('aria-activedescendant', menuItem && menuItem.el.id || '');
        }
    }
165752
def handleClick(self, item, column):
        
        if item.text(0) == 'add another item':
            new_item = self.addEntry()
            self.setCurrentItem(new_item, 1)
            self.editItem(new_item, 1)
        
        elif column == 0:
            self.takeTopLevelItem(self.indexOfTopLevelItem(item))
1020988
public void updateItem (T item)
    {
        if (_items == null) {
            return;
        }
        int idx = _items.indexOf(item);
        if (idx == -1) {
            _items.add(0, item);
        } else {
            _items.set(idx, item);
        }
    }
569074
public void setItem(java.util.Collection<EndpointBatchItem> item) {
        if (item == null) {
            this.item = null;
            return;
        }

        this.item = new java.util.ArrayList<EndpointBatchItem>(item);
    }
1316889
protected void doChecks(CacheItem item, List<CacheItem> itemsToRefresh) {
        boolean expired;
        boolean willBeRefreshed;

        try {
            expired = checkForExpiration(item);
            if (expired) {
                if (logger.isDebugEnabled()) {
                    logger.debug(item + " was removed because it expired");
                }
            } else {
                willBeRefreshed = checkForRefresh(item, itemsToRefresh);
                if (willBeRefreshed) {
                    if (logger.isDebugEnabled()) {
                        logger.debug(item + " will be refreshed");
                    }
                }
            }
        } catch (Exception ex) {
            logger.warn("Exception while checking " + item + " for expiration/refresh", ex);
        }
    }
2130
public synchronized void push(@Nullable T item) {
        if( waiting == null ) {
            throw new IllegalStateException("Invalid attempt to add an item to a completed list.");
        }
        if( filter != null ) {
            try {
                if( !filter.filter(item) ) {
                    return;
                }
            }
            catch( Throwable t ) {
                logger.error("[" + this + "] Error filtering " + item + ": " + t.getMessage());
                Exception e;
                
                if( t instanceof Exception ) {
                    e = (Exception)t;
                }
                else {
                    e = new RuntimeException(t);
                }
                setLoadException(e);
                return;
            }
        }
        waiting.add(item);
        lastTouch = System.currentTimeMillis();
        notifyAll();
    }
1228237
function wrapCBMiddleware(handler, action) {
		// Merge action option and broker options
		const opts = Object.assign({}, this.options.circuitBreaker || {}, action.circuitBreaker || {});
		if (opts.enabled) {
			return function circuitBreakerMiddleware(ctx) {
				// Get endpoint state item
				const ep = ctx.endpoint;
				const item = getEpState(ep, opts);

				// Handle half-open state in circuit breaker
				if (item.state == C.CIRCUIT_HALF_OPEN) {
					halfOpenWait(item, ctx);
				}

				// Call the handler
				return handler(ctx).then(res => {
					const item = getEpState(ep, opts);
					success(item, ctx);

					return res;
				}).catch(err => {
					if (opts.check && opts.check(err)) {
						// Failure if error is created locally (not came from a 3rd node error)
						if (item && (!err.nodeID || err.nodeID == ctx.nodeID)) {
							const item = getEpState(ep, opts);
							failure(item, err, ctx);
						}
					}

					return this.Promise.reject(err);
				});
			}.bind(this);
		}

		return handler;
	}
236344
def __request_start(self, queue_item):
        

        try:
            action = self.__options.callbacks.request_before_start(self.queue, queue_item)
        except Exception as e:
            action = None
            print(e)
            print(traceback.format_exc())

        if action == CrawlerActions.DO_STOP_CRAWLING:
            self.__should_stop = True

        if action == CrawlerActions.DO_SKIP_TO_NEXT:
            self.queue.move(queue_item, QueueItem.STATUS_FINISHED)
            self.__should_spawn_new_requests = True

        if action == CrawlerActions.DO_CONTINUE_CRAWLING or action is None:
            self.queue.move(queue_item, QueueItem.STATUS_IN_PROGRESS)

            thread = CrawlerThread(self.__request_finish, self.__lock, self.__options, queue_item)
            self.__threads[queue_item.get_hash()] = thread
            thread.daemon = True
            thread.start()
468283
function(ctx) {
				var activate,
					expand,
					// event = ctx.originalEvent,
					targetType = ctx.targetType,
					node = ctx.node;

				// this.debug("ftnode.onClick(" + event.type + "): ftnode:" + this + ", button:" + event.button + ", which: " + event.which, ctx);
				// TODO: use switch
				// TODO: make sure clicks on embedded <input> doesn't steal focus (see table sample)
				if (targetType === "expander") {
					if (node.isLoading()) {
						// #495: we probably got a click event while a lazy load is pending.
						// The 'expanded' state is not yet set, so 'toggle' would expand
						// and trigger lazyLoad again.
						// It would be better to allow to collapse/expand the status node
						// while loading (instead of ignoring), but that would require some
						// more work.
						node.debug("Got 2nd click while loading: ignored");
						return;
					}
					// Clicking the expander icon always expands/collapses
					this._callHook("nodeToggleExpanded", ctx);
				} else if (targetType === "checkbox") {
					// Clicking the checkbox always (de)selects
					this._callHook("nodeToggleSelected", ctx);
					if (ctx.options.focusOnSelect) {
						// #358
						this._callHook("nodeSetFocus", ctx, true);
					}
				} else {
					// Honor `clickFolderMode` for
					expand = false;
					activate = true;
					if (node.folder) {
						switch (ctx.options.clickFolderMode) {
							case 2: // expand only
								expand = true;
								activate = false;
								break;
							case 3: // expand and activate
								activate = true;
								expand = true; //!node.isExpanded();
								break;
							// else 1 or 4: just activate
						}
					}
					if (activate) {
						this.nodeSetFocus(ctx);
						this._callHook("nodeSetActive", ctx, true);
					}
					if (expand) {
						if (!activate) {
							// this._callHook("nodeSetFocus", ctx);
						}
						// this._callHook("nodeSetExpanded", ctx, true);
						this._callHook("nodeToggleExpanded", ctx);
					}
				}
				// Make sure that clicks stop, otherwise <a href='#'> jumps to the top
				// if(event.target.localName === "a" && event.target.className === "fancytree-title"){
				// 	event.preventDefault();
				// }
				// TODO: return promise?
			}
806915
function getEpState(ep, opts) {
		let item = store.get(ep.name);
		if (!item) {
			item = {
				ep,
				opts,
				count: 0,
				failures: 0,
				state: C.CIRCUIT_CLOSE,
				cbTimer: null
			};
			store.set(ep.name, item);
		}
		return item;
	}
1175069
function( item, index ) {
        $.console.assert(item, "[World.setItemIndex] item is required");
        $.console.assert(index !== undefined, "[World.setItemIndex] index is required");

        var oldIndex = this.getIndexOfItem( item );

        if ( index >= this._items.length ) {
            throw new Error( "Index bigger than number of layers." );
        }

        if ( index === oldIndex || oldIndex === -1 ) {
            return;
        }

        this._items.splice( oldIndex, 1 );
        this._items.splice( index, 0, item );
        this._needsDraw = true;

        /**
         * Raised when the order of the indexes has been changed.
         * @event item-index-change
         * @memberOf OpenSeadragon.World
         * @type {object}
         * @property {OpenSeadragon.World} eventSource - A reference to the World which raised the event.
         * @property {OpenSeadragon.TiledImage} item - The item whose index has
         * been changed
         * @property {Number} previousIndex - The previous index of the item
         * @property {Number} newIndex - The new index of the item
         * @property {?Object} userData - Arbitrary subscriber-defined object.
         */
        this.raiseEvent( 'item-index-change', {
            item: item,
            previousIndex: oldIndex,
            newIndex: index
        } );
    }
1041153
private void updateSingeItemIterator(SelectItem item) {

        if (singleItemIterator == null) {
            singleItemIterator = new SingleElementIterator();
        }
        singleItemIterator.updateItem(item);

    }
226796
function _getItemUnready(item) {
  item.classList.remove('ready');
  item.removeAttribute(OFFSET);
  item.style.webkitTransitionDuration = '0';
  item.style.webkitTransform = 'none';
}
260698
function(e) {
			var self = this;
	
			if (self.isLocked) return;
			if (self.settings.mode === 'multi') {
				e.preventDefault();
				self.setActiveItem(e.currentTarget, e);
			}
		}
1093832
public synchronized void putInt(int item)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "putInt", Integer.valueOf(item));

      checkValid();
      getCurrentByteBuffer(4).putInt(item);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "putInt");
   }
701695
function (data, circuitbreakerState, callback) {

        const responder = (circuitbreakerState===CB.OPEN) ? config.bypass : config.handler;

        // call the handler using its expected paradigm
        const promise = responder.length > 1
            ? new Promise(function(resolve, reject) {
                responder(data, function(err, result) {
                    if (err) return reject(err);
                    resolve(result);
                });
            })
            : Promise.resolve(responder(data));

        // provide an asynchronous response in the expected paradigm
        if (typeof callback !== 'function') return promise;
        promise.then(
            function (data) { callback(null, data); },
            function (err) { callback(err, null); }
        );
    }