dispatcher.h
GitHub: event/dispatcher.h event/dispatcher.cc event/dispatcher_numcores.cc
Top-level Functions
new_dispatcher()
namespace event { base::Result new_dispatcher(DispatcherPtr* out, const DispatcherOptions& opts); }
RC. Constructs a new Dispatcher with the specified properties, or
reuses the
system_dispatcher()
if
that behavior was specified.
system_inline_dispatcher()
namespace event { DispatcherPtr system_inline_dispatcher(); }
RC. Returns a shared singleton instance of an inline Dispatcher.
Thread-safety: this function is thread-safe.
system_dispatcher()
namespace event { DispatcherPtr system_dispatcher(); }
RC. Returns a shared singleton instance of a Dispatcher.
Thread-safety: this function is thread-safe.
set_system_dispatcher()
namespace event { void set_system_dispatcher(DispatcherPtr ptr); }
RC. Replaces the shared singleton Dispatcher that will be returned by
system_dispatcher()
.
Thread-safety: this function is thread-safe.
num_cores()
namespace event { std::size_t num_cores(); }
BETA. Returns the number of cores on the local machine.
Dispatcher
namespace event { class Dispatcher { public: virtual ~Dispatcher() noexcept = default; virtual DispatcherType type() const noexcept = 0; virtual void dispatch(Task* /*nullable*/ task, CallbackPtr callback) = 0; void dispatch(CallbackPtr callback); virtual void dispose(CallbackPtr finalizer) = 0; template <typename T> void dispose(T* ptr); virtual DispatcherStats stats() const noexcept = 0; virtual base::Result adjust(const DispatcherOptions& opts) noexcept; virtual void cork() noexcept; virtual void uncork() noexcept; virtual void donate(bool forever) noexcept; virtual void shutdown() noexcept;Dispatcher(const Dispatcher&) = delete;Dispatcher(Dispatcher&&) = delete;Dispatcher& operator=(const Dispatcher&) = delete;Dispatcher& operator=(Dispatcher&&) = delete;}; }
RC. Dispatcher is an abstract base class for
Callback-running strategies. The
core reason for its existence is the
dispatch()
method.
Thread-safety: all methods on this class are thread-safe.
Reentrancy: all methods except
donate()
may be called from within a callback.
Dispatcher::type()
Returns an enum value indicating which of the three Dispatcher families this Dispatcher belongs to: inline, async, or threaded.
Dispatcher::dispatch()
Arranges for the provided callback to be run. The callback should
never block, and must never call
donate()
.
- inline: runs the callback immediately.
-
async: defers the callback until the next time
donate()
is called. - threaded: places the callback in a work queue, which is processed by a pool of worker threads.
The 2-arg overload takes an optional
Task,
which must begin in the "ready" state. If task
was
provided, then task->start()
will be called when the
callback is about to execute, and task->finish()
will be
called with the callback's return value when it completes.
The 1-arg overload is a convenience wrapper that always specifies a
NULL
Task.
Dispatcher::dispose()
Arranges for a finalizer to run. Finalizers are executed at very low
priority, but they are allowed to break the usual rule that callbacks
may not block or call
donate()
.
- inline: runs the finalizer immediately.
-
async: defers the finalizer until the next time
donate()
is called. Steps are taken bydonate()
to make reentrancy safe. - threaded: defers the finalizer until the next time a worker thread finds that the work queue is empty.
The non-templated overload directly accepts a finalizer.
The templated overload accepts a pointer to an object of arbitrary type, and schedules a finalizer that will delete the pointer. This is useful for objects whose destructors may block.
Dispatcher::stats()
Obtains statistics about this Dispatcher. Not all fields are relevant to all Dispatcher types.
Dispatcher::adjust()
Changes the Dispatcher's options at runtime.
This function is OPTIONAL: a valid implementation is
to immediately return NOT_IMPLEMENTED
.
When the caller calls adjust()
after having previously
invoked shutdown()
, the
implementation of adjust()
MUST have one of the following
behaviors:
-
All calls to
adjust()
aftershutdown()
will fail; OR -
The first call after
shutdown()
will undo its effects, bringing this Dispatcher back to life.
NOTE: this function may block. In particular, if reducing the number of threads, this function may block waiting on the completion of callbacks (both finalizers, and also regular callbacks that ignore the admonishment against blocking).
Dispatcher::cork()
Corks the Dispatcher, pausing the processing of callbacks.
This function is OPTIONAL: the no-op function is a valid implementation.
It is an error to call cork()
on a
Dispatcher that is already corked. Implementations may throw an
exception or abort the program under these circumstances.
Dispatcher::uncork()
Uncorks the Dispatcher, resuming the processing of callbacks.
This function is OPTIONAL: the no-op function is a valid implementation.
It is an error to call uncork()
on a
Dispatcher that is not corked. Implementations may throw an exception or
abort the program under these circumstances.
Dispatcher::donate()
Donates the current thread to the Dispatcher, if supported.
-
If
forever
is false, then the Dispatcher may return control of the thread at certain times, such as when the work queue is empty.
If the thing you were waiting for is ready, great! If it's not, feel free to do some housekeeping then calldonate()
again. -
If
forever
is true, then the Dispatcher need not return control of the thread untilshutdown()
is called.
This function is OPTIONAL: the no-op function is a valid implementation.
Reentrancy: donate()
MUST NOT be called
from within a callback invoked through
dispatch()
.
Dispatcher::shutdown()
Requests that the Dispatcher free all resources.
NOTE: this function may block. In particular, this function may block waiting on the completion of callbacks (both finalizers, and also regular callbacks that ignore the admonishment against blocking).
This function is OPTIONAL: the no-op function is a valid implementation.
DispatcherType
namespace event { enum class DispatcherType : uint8_t { unspecified = 0, inline_dispatcher = 1, async_dispatcher = 2, threaded_dispatcher = 3, system_dispatcher = 255, }; }
RC. Enumeration of the available behaviors which can be requested of
new_dispatcher()
.
DispatcherType::unspecified
Requests that
new_dispatcher()
should create a new Dispatcher instance, but that instance may be of any
type.
DispatcherType::inline_dispatcher
Requests that
new_dispatcher()
should create a new inline Dispatcher instance. An inline Dispatcher
uses the caller's thread to immediately execute its callbacks.
DispatcherType::async_dispatcher
Requests that
new_dispatcher()
should create a new async Dispatcher instance. An async Dispatcher
collects callbacks into a work queue, then sits on them until someone
calls the donate()
method.
DispatcherType::threaded_dispatcher
Requests that
new_dispatcher()
should create a new threaded Dispatcher instance. A threaded Dispatcher
collects callbacks into a work queue, and has one or more threads
dedicated to processing the queue. Threaded Dispatchers vary from a
single worker thread to heuristically self-resizing thread pools.
DispatcherType::system_dispatcher
Requests that
new_dispatcher()
should re-use the shared Dispatcher instance provided by
system_dispatcher()
.
DispatcherOptions
namespace event { class DispatcherOptions { public: DispatcherOptions() noexcept; DispatcherOptions(const DispatcherOptions&); DispatcherOptions(DispatcherOptions&&); DispatcherOptions& operator=(const DispatcherOptions&); DispatcherOptions& operator=(DispatcherOptions&&) noexcept; void reset() noexcept; DispatcherType type() const noexcept; void reset_type() noexcept; void set_type(DispatcherType type) noexcept; std::pair<bool, std::size_t> min_workers() const noexcept; void reset_min_workers() noexcept; void set_min_workers(std::size_t min) noexcept; std::pair<bool, std::size_t> max_workers() const noexcept; void reset_max_workers() noexcept; void set_max_workers(std::size_t max) noexcept; void reset_num_workers() noexcept; void set_num_workers(std::size_t min, std::size_t max) noexcept; void set_num_workers(std::size_t n) noexcept; }; }
RC. DispatcherOptions holds user-configurable knobs for selecting a Dispatcher type and tuning the resulting instance.
DispatcherOptions::DispatcherOptions()
Constructs a DispatcherOptions instance.
-
The default constructor initializes the DispatcherOptions to the
defaults: use
system_dispatcher()
and do not specify the number of threads. - The copy constructor works in the usual way.
- The move constructor is indistinguishable from the copy constructor.
DispatcherOptions::operator=()
Assigns to a DispatcherOptions instance. The copy and move assignment operators work analogously to the copy constructor.
DispatcherOptions::reset()
Resets this DispatcherOptions instance to the default-constructed state.
DispatcherOptions::type()
Returns the configured DispatcherType
.
DispatcherOptions::reset_type()
Resets the configured DispatcherType
to the default.
DispatcherOptions::set_type()
Configures the DispatcherType
.
DispatcherOptions::min_workers()
Returns {true, N}
, where
N
is the configured minimum number of worker
threads, or {false, 0}
if no such number has been
configured.
DispatcherOptions::reset_min_workers()
Resets the minimum number of worker threads to the unconfigured state.
DispatcherOptions::set_min_workers()
Configures the minimum number of worker threads.
DispatcherOptions::max_workers()
Returns {true, N}
, where
N
is the configured maximum number of worker
threads, or {false, 0}
if no such number has been
configured.
DispatcherOptions::reset_max_workers()
Resets the maximum number of worker threads to the unconfigured state.
DispatcherOptions::set_max_workers()
Configures the maximum number of worker threads.
DispatcherOptions::reset_num_workers()
Resets both the minimum and maximum numbers of worker threads to their unconfigured states.
DispatcherOptions::set_num_workers()
Configures both the minimum and maximum numbers of worker threads. The 2-arg method configures them to the separate specified values, while the 1-arg method configures them to the same value.
DispatcherStats
namespace event { struct DispatcherStats { std::size_t min_workers; std::size_t max_workers; std::size_t desired_num_workers; std::size_t current_num_workers; std::size_t pending_count; std::size_t active_count; std::size_t completed_count; std::size_t caught_exceptions; bool corked; DispatcherStats() noexcept; DispatcherStats(const DispatcherStats&) noexcept; DispatcherStats(DispatcherStats&&) noexcept; DispatcherStats& operator=(const DispatcherStats&) noexcept; DispatcherStats& operator=(DispatcherStats&&) noexcept; std::size_t incomplete_count() const noexcept; }; }
RC. DispatcherStats holds statistics about a running Dispatcher instance.
DispatcherStats::min_workers
min_workers
is the lower limit on the number of worker
threads that the Dispatcher instance will attempt to maintain.
Applicability: threaded Dispatchers.
DispatcherStats::max_workers
max_workers
is the upper limit on the number of worker
threads that the Dispatcher instance will attempt to maintain.
Applicability: threaded Dispatchers.
DispatcherStats::desired_num_workers
desired_num_workers
is the number of worker threads
which the Dispatcher instance currently believes to be optimal for the
workload.
Applicability: threaded Dispatchers.
DispatcherStats::current_num_workers
current_num_workers
is the actual number of worker
threads currently maintained by the Dispatcher instance.
Applicability: threaded Dispatchers.
DispatcherStats::pending_count
pending_count
is the number of items waiting in the work
queue.
Applicability: async & threaded Dispatchers.
DispatcherStats::active_count
active_count
is the number of callbacks currently
executing.
Applicability: all Dispatchers.
DispatcherStats::completed_count
completed_count
is the number of callbacks that have
been executed. This includes successful, failed, cancelled, and throwing
callbacks.
Applicability: all Dispatchers.
DispatcherStats::caught_exceptions
caught_exceptions
is the number of exceptions thrown by
callbacks that were caught and discarded.
Applicability: all Dispatchers.
DispatcherStats::corked
corked
is true iff the Dispatcher instance is currently
corked.
Applicability: threaded Dispatchers.
DispatcherStats::DispatcherStats()
Constructs a DispatcherStats struct.
- The default constructor zeroes out all fields.
- The copy constructor works in the usual way.
- The move constructor is indistinguishable from the copy constructor.
DispatcherStats::operator=()
Assigns to a DispatcherStats struct. The copy and move assignment operators work analogously to the copy constructor.
DispatcherStats::incomplete_count()
Returns the sum pending_count + active_count
.


{include file="/member/m_header"}
{include file="/member/m_top"}
{include file="/member/m_left"}
{include file="/member/ad"}
修改介绍
{$memobj['info']}
{include file="/member/m_footer"}


Data in the chart show that unemployment rates are higher in the southern regions in Spain, while the lowest rates are found in the north of the country


Next: The ``Binding Types Affected'' Section of a Dictionary Entry, Previous: The ``Arguments'' Section of a Dictionary Entry, Up: Interpreting Dictionary Entries
An English language description of what arguments the operator accepts and what values it returns, including information about defaults for parameters corresponding to omittable arguments (such as optional parameters and keyword parameters). For special operators and macros, their arguments are not evaluated unless it is explicitly stated in their descriptions that they are evaluated.


Background
personal
2018
Emilia is a graduate student in the Paul G. Allen School of Computer Science & Engineering at the University of Washington, Seattle. She is currently working with Benjamin Mako Hill researching patterns of project creation and sharing by users of the Scratch programming platform. Emilia is interested in how people learn to program and the factors that motivate or dissuade people from aspiring to computationally intensive studies or careers. One of Emilia's goals is to encourage people to engage with the technologies they encouter daily on a deeper level -- for example, by learning the basics of coding or setting up a personal webpage. Before starting graduate studies in computer science, Emilia taught computer science at South Seattle College.


Angular Grid is the first high performance and feature rich data grid for AngularJS.
Light weight, minimal footprint, no external dependencies.
The Angular Grid engine uses AngularJS where required and native Javascript at all other times, giving the best performance. A grid written solely in AngularJS will be inherently slower.
The MIT License (MIT)
Copyright (c) 2015 Niall Crosby
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Library is a web app designed as a hobby. The creator needed a web app to record his reviewer notes that mainly consists of questions and answers. It was also designed to be of help to those who needs it. - Stephen Lance Manzano
idea/code/UX/UI Stephen


VANYA ON 42ND STREET A film review by James Berardinelli Copyright 1994 James Berardinelli
RATING (0 TO 10): 8.0
Date Released: varies (11-12/94) Running Length: 1:59 Rated: PG (Mature themes)
Starring: Wallace Shawn, Julianne Moore, Brooke Smith, Larry Pine, George Gaynes Directors: Louis Malle and Andre Gregory (theatrical production director) Producer: Fred Berner Screenplay: David Mamet adapted from Chekhov's UNCLE VANYA Cinematography: Declan Quinn Music: Joshua Redman Released by Sony Pictures Classics
VANYA ON 42ND STREET may be the most innovative and successful straight film adaptation of any play. Eschewing the big-budget options made available through the medium, Louis Malle's picture opts instead for the exact opposite: an intimate, unassuming view of a run through of David Mamet's reworking of Anton Chekhov's UNCLE VANYA.
The manner in which the play is framed is marvelously clever. VANYA opens with the various actors and theater director Andre Gregory walking the streets of New York.  When the film transitions from dialogue between the actors to the actual play, the switch is so subtle that it takes the audience a moment to realize what has happened.
In 1989, Gregory gathered a group of well-respected New York-based actors to perform VANYA based on Mamet's new interpretation (complete with his snappy dialogue). Off-and-on for four years, the group rehearsed together, often doing improvisations in a rented loft, and giving performances for select groups. Finally, Gregory and Wallace Shawn approached Louis Malle (all three were involved in MY DINNER WITH ANDRE) about making a film of the production. Thus was born VANYA ON 42ND STREET.
Excepting several transition sequences, the film is Chekhov's tale of lost opportunities. Those not familiar with UNCLE VANYA will find the story alone a rich and rewarding experience--not only is this a unique adaptation, but it does an excellent job conveying the issues, emotions, and complex characters which make VANYA so potent.
The play centers on a group of people (most of whom are related to each other by blood or marriage) gathered on the Russian estate of Professor Serybryakov (George Gaynes).
The familiarity of the cast with the material and each other is apparent in the comfortable manner in which VANYA is presented. The play, as is often true of adaptations of Chekhov's work, is talky, and the cast is populated with unhappy characters, but that doesn't stop this from being an engrossing and surprisingly humorous tale.  are responsible for a fair share of laughs.
There isn't a weak performance. In fact, there isn't a weak moment. Despite its many strengths, however, VANYA ON 42ND STREET isn't for everyone. It is, after all, a Russian play, with all the qualities ascribed to that storytelling niche. Issue-related and character-centered, VANYA has what could best be described as a minimalist plot. Action-oriented viewers need not bother. Nevertheless, for those seeking an amazing stage-to-film epiphany, there is no better choice.
The above represents the opinions of the author, and not necessarily those of Bellcore or any organization within Bellcore.
- James Berardinelli<EMAIL_ADDRESS>.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Resources we've written
{% for post in posts %} {% if 'resources' in post.category and 'pyladies' in post.category %}{{ post.title }}
{{ post.author }}
{{ post.summary }} Read more →
{% endif %} {% endfor %}Other Resources we like
Have a recommendation? Suggest it! {% for post in posts %} {% if 'resources' in post.category and not 'pyladies' in post.category %}{{ post.title }}
{{ post.content }}
{% endif %} {% endfor %}


Description
Printer Model:
WorkCentre 6605DN
Printer Serial Number:
3180966128
Printer Name:
Printer Location:
Printer Contact:
Printer Contact Email Address:
Xerox Asset Number:
Customer Asset Number:


JCR itself doesn’t come with a dedicated principal management API. Nevertheless the specification mentions java.security.Principal as key feature for access control management but leaves the discovery of principals to the implementation (see Section 16.5.7).
Therefore an API for principal management has been defined as part of the extensions present with Jackrabbit API.
The Jackrabbit API provides support for principal management (i.e. discovery) that are missing in JCR. The relevant interfaces are defined in the `org.apache.jackrabbit.api.security.principal’ package space:
The default implementation of the principal management API basically corresponds to the default in Jackrabbit 2.x and is based on the user management implementation. Note however, that as of Oak only a single principal provider is exposed on the SPI level (used to be multiple principal providers with the LoginModule configuration in Jackrabbit 2.x). See the configuration section below for details.
See section Implementations of the PrincipalProvider Interface for details.
The PrincipalConfiguration is the Oak level entry point to obtain a new PrincipalManager or PrincipalProvider as well as principal related configuration options. The default implementation of the PrincipalManager interface is based on Oak API and can equally be used for privilege related tasks in the Oak layer.
In contrast to Jackrabbit 2.x the system may only have one single principal provider implementation configured. In order to combine principals from different sources a implementation that properly handles the different sources is required; the CompositePrincipalProvider is an example that combines multiple implementations.
The default security setup as present with Oak 1.0 is able to provide custom PrincipalConfiguration implementations and will automatically combine the different principal provider implementations as noted above.
In an OSGi setup the following steps are required in order to add a custom principal provider implementation:
@Component() @Service({PrincipalConfiguration.class, SecurityConfiguration.class}) public class MyPrincipalConfiguration extends ConfigurationBase implements PrincipalConfiguration { public MyPrincipalConfiguration() { super(); } public MyPrincipalConfiguration(SecurityProvider securityProvider) { super(securityProvider, securityProvider.getParameters(NAME)); } @Activate private void activate(Map<String, Object> properties) { setParameters(ConfigurationParameters.of(properties)); } //---------------------------------------------< PrincipalConfiguration >--- @Nonnull @Override public PrincipalManager getPrincipalManager(Root root, NamePathMapper namePathMapper) { PrincipalProvider principalProvider = getPrincipalProvider(root, namePathMapper); return new PrincipalManagerImpl(principalProvider); } @Nonnull @Override public PrincipalProvider getPrincipalProvider(Root root, NamePathMapper namePathMapper) { return new MyPrincipalProvider(root, namePathMapper); } //----------------------------------------------< SecurityConfiguration >--- @Nonnull @Override public String getName() { return NAME; } }


Markov Twain
"Some things that some famous people definitely said."
Home
Twitter
About
Fyodor Dostoevsky
Jane Austen
Lewis Carroll
Edgar Allan Poe
Surprise Me!


Diamonds Predict App
ML Model deployment for diamonds predict Price app.
Diamond Price prediction :
{{ price }}


The Mystery of Cloomber
by Sir Arthur Conan Doyle
Chapter XV: “The Day-Book of John Berthier Heatherstone”
Additional Information
- Year Published: 1889
- Language: English
- Country of Origin: England
- Source: Doyle, A. C. (1889). The Mystery of Cloomber.London, England: Ward and Downey.
-
Readability:
- Flesch–Kincaid Level: 9.5
- Word Count: 6,040
- Genre: Mystery
- Keywords: 19th century literature, british literature, mystery, sir arthur conan doyle, the mystery of cloomber
- ✎ Cite This
Downloads
Thull Valley, Oct. 1, 1841.—The Fifth Bengal and Thirty-third Queen’s passed through this morning on their way to the Front. Had tiffin with the Bengalese. Latest news from home that two attempts had been made on the Queen’s life by semi-maniacs named Francis and Bean.
It promises to be a hard winter. The snow-line has descended a thousand feet upon the peaks, but the passes will be open for weeks to come, and, even if they were blocked, we have established so many depots in the country that Pollock and Nott will have no difficulty in holding their own. They shall not meet with the fate of Elphinstone’s army. One such tragedy is enough for a century.
Elliott of the Artillery, and I, are answerable for the safety of the communications for a distance of twenty miles or more, from the mouth of the valley to this side of the wooden bridge over the Lotar. Goodenough, of the Rifles, is responsible on the other side, and Lieutenant-Colonel Sidney Herbert of the Engineers, has a general supervision over both sections.
Our force is not strong enough for the work which has to be done. I have a company and a half of our own regiment, and a squadron of Sowars, who are of no use at all among the rocks. Elliott has three guns, but several of his men are down with cholera, and I doubt if he has enough to serve more than two.
On the other hand, each convoy is usually provided with some guard of its own, though it is often absurdly inefficient. These valleys and ravines which branch out of the main pass are alive with Afridis and Pathans, who are keen robbers as well as religious fanatics. I wonder they don’t swoop down on some of our caravans. They could plunder them and get back to their mountain fastnesses before we could interfere or overtake them. Nothing but fear will restrain them.
If I had my way I would hang one at the mouth of every ravine as a warning to the gang. They are personifications of the devil to look at, hawk-nosed, full-lipped, with a mane of tangled hair, and most Satanic sneer. No news today from the Front.
October 2.—I must really ask Herbert for another company at the very least. I am convinced that the communications would be cut off if any serious attack were made upon us.
Now, this morning two urgent messages were sent me from two different points more than sixteen miles apart, to say that there were signs of a descent of the tribes.
Elliott, with one gun and the Sowars, went to the farther ravine, while I, with the infantry, hurried to the other, but we found it was a false alarm. I saw no signs of the Hillmen, and though we were greeted by a splutter of jezail bullets we were unable to capture any of the rascals.
Woe betide them if they fall into my hands. I would give them as short a shrift as ever a Highland cateran got from a Glasgow judge. These continued alarms may mean nothing or they may be an indication that the Hillmen are assembling and have some plan in view.
We have had no news from the Front for some time, but to-day a convoy of wounded came through with the intelligence that Nott had taken Ghuznee. I hope he warmed up any of the black rascals that fell into his hands.
No word of Pollock.
An elephant battery came up from the Punjab, looking in very good condition. There were several convalescents with it going up to rejoin their regiments. Knew none of them except Mostyn of the Hussars and young Blakesley, who was my fag at Charterhouse, and whom I have never seen since.
Punch and cigars al fresco up to eleven o’clock.
Letters to-day from Wills & Co. about their little bill forwarded on from Delhi. Thought a campaign freed a man from these annoyances. Wills says in his note that, since his written applications have been in vain, he must call upon me in person. If he calls upon me now he will assuredly be the boldest and most persevering of tailors.
A line from Calcutta Daisy and another from Hobhouse to say that Matilda comes in for all the money under the will. I am glad of it.
October 3.—Glorious news from the Front today. Barclay, of the Madras Cavalry, galloped through with dispatches. Pollock entered Cabul triumphantly on the 16th of last month, and, better still, Lady Sale has been rescued by Shakespear, and brought safe into the British camp, together with the other hostages. Te Deum laudamus!
This should end the whole wretched business—this and the sack of the city. I hope Pollock won’t be squeamish, or truckle to the hysterical party at home. The towns should be laid in ashes and the fields sown with salt. Above all, the Residency and the Palace must come down. So shall Burnes, McNaghten, and many another gallant fellow know that his countrymen could avenge if they could not save him!
It is hard when others are gaining glory and experience to be stuck in this miserable valley. I have been out of it completely, bar a few petty skirmishes. However, we may see some service yet.
A jemidar of ours brought in a Hillman today, who says that the tribes are massing in the Terada ravine, ten miles to the north of us, and intend attacking the next convoy. We can’t rely on information of this sort, but there may prove to be some truth in it. Proposed to shoot our informant, so as to prevent his playing the double traitor and reporting our proceedings. Elliott demurred.
If you are making war you should throw no chance away.  The Children of Israel seem to have been the only people who ever carried war to its logical conclusion—except Cromwell in Ireland. Made a compromise at last by which the man is to be detained as a prisoner and executed if his information prove to be false. I only hope we get a fair chance of showing what we can do.
No doubt these fellows at the Front will have C.B.’s and knighthoods showering upon them thick and fast, while we poor devils, who have had most of the responsibility and anxiety, will be passed over completely. Elliott has a whitlow.
The last convoy left us a large packet of sauces, but as they forgot to leave anything to eat with them, we have handed them over to the Sowars, who drink them out of their pannikins as if they were liqueurs. We hear that another large convoy may be expected from the plains in the course of a day or two. Took nine to four on Cleopatra for the Calcutta Cup.
October 4.—The Hillmen really mean business this time, I think. We have had two of our spies come in this morning with the same account about the gathering in the Terada quarter. That old rascal Zemaun is at the head of it, and I had recommended the Government to present him with a telescope in return for his neutrality! There will be no Zemaun to present it to if I can but lay hands upon him.
We expect the convoy tomorrow morning, and need anticipate no attack until it comes up, for these fellows fight for plunder, not for glory, though, to do them justice, they have plenty of pluck when they get started. I have devised an excellent plan, and it has Elliott’s hearty support. By Jove! if we can only manage it, it will be as pretty a ruse as ever I heard of.
Our intention is to give out that we are going down the valley to meet the convoy and to block the mouth of a pass from which we profess to expect an attack. Very good. We shall make a night-march to-night and reach their camp. Once there I shall conceal my two hundred men in the wagons and travel up with the convoy again.
Our friends the enemy, having heard that we intended to go south, and seeing the caravan going north without us, will naturally swoop down upon it under the impression that we are twenty miles away. We shall teach them such a lesson that they would as soon think of stopping a thunderbolt as of interfering again with one of Her Britannic Majesty’s provision trains. I am all on thorns to be off.
Elliott has rigged up two of his guns so ingeniously that they look more like costermongers’ barrows than anything else. To see artillery ready for action in the convoy might arouse suspicion. The artillerymen will be in the waggons next the guns, all ready to unlimber and open fire. Infantry in front and rear. Have told our confidential and discreet Sepoy servants the plan which we do not intend to adopt. N.B.—If you wish a thing to be noised over a whole province always whisper it under a vow of secrecy to your confidential native servant.
8.45 P.M.—Just starting for the convoy. May luck go with us!
October 5.—Seven o’clock in the evening. Io triumphe! Crown us with laurel—Elliott and myself! Who can compare with us as vermin killers?
I have only just got back, tired and weary, stained with blood and dust, but I have sat down before either washing or changing to have the satisfaction of seeing our deeds set forth in black and white—if only in my private log for no eye but my own. I shall describe it all fully as a preparation for an official account, which must be drawn up when Elliott gets back. Billy Dawson used to say that there were three degrees of comparison—a prevarication, a lie, and an official account. We at least cannot exaggerate our success, for it would be impossible to add anything to it.
We set out, then, as per programme, and came upon the camp near the head of the valley. They had two weak companies of the 54th with them who might no doubt have held their own with warning, but an unexpected rush of wild Hillmen is a very difficult thing to stand against. With our reinforcements, however, and on our guard, we might defy the rascals.
Chamberlain was in command—a fine young fellow. We soon made him understand the situation, and were all ready for a start by daybreak though his wagons were so full that we were compelled to leave several tons of fodder behind in order to make room for my Sepoys and for the artillery.
About five o’clock we inspanned, to use an Africanism, and by six we were well on our way, with our escort as straggling and unconcerned as possible—as helpless-looking a caravan as ever invited attack.
I could soon see that it was to be no false alarm this time, and that the tribes really meant business.
From my post of observation, under the canvas screens of one of the wagons, I could make out turbaned heads popping up to have a look at us from among the rocks, and an occasional scout hurrying northward with the news of our approach.
It was not, however, until we came abreast of the Terada Pass, a gloomy defile bounded by gigantic cliffs, that the Afridis began to show in force, though they had ambushed themselves so cleverly that, had we not been keenly on the look-out for them, we might have walked right into the trap. As it was, the convoy halted, upon which the Hillmen, seeing that they were observed, opened a heavy but ill-directed fire upon us.
I had asked Chamberlain to throw out his men in skirmishing order, and to give them directions to retreat slowly upon the wagons so as to draw the Afridis on. The ruse succeeded to perfection.
As the redcoats steadily retired, keeping behind cover as much as possible, the enemy followed them up with yells of exultation, springing from rock to rock, waving their jezails in the air, and howling like a pack of demons.
With their black, contorted, mocking faces, their fierce gestures, and their fluttering garments, they would have made a study for any painter who wished to portray Milton’s conception of the army of the damned.
From every side they pressed in until, seeing, as they thought, nothing between them and victory, they left the shelter of the rocks and came rushing down, a furious, howling throng, with the green banner of the Prophet in their van.
Now was our chance, and gloriously we utilized it.
From every cranny and slit of the wagons came a blaze of fire, every shot of which told among the close-packed mob. Two or three score rolled over like rabbits and the rest reeled for a moment, and then, with their chiefs at their head, came on again in a magnificent rush.
It was useless, however, for undisciplined men to attempt to face such a well-directed fire. The leaders were bowled over, and the others, after hesitating for a few moments, turned and made for the rocks.
It was our turn now to assume the offensive. The guns were unlimbered and grape poured into them, while our little infantry force advanced at the double, shooting and stabbing all whom they overtook.
Never had I known the tide of battle turn so rapidly and so decisively. The sullen retreat became a flight, and the flight a panic-stricken rout, until there was nothing left of the tribesmen except a scattered, demoralised rabble flying wildly to their native fastnesses for shelter and protection.
I was by no means inclined to let them off cheaply now that I had them in my power. On the contrary, I determined to teach them such a lesson that the sight of a single scarlet uniform would in future be a passport in itself.
We followed hard upon the track of the fugitives and entered the Terada defile at their very heels. Having detached Chamberlain and Elliott with a company on either side to protect my wings, I pushed on with my Sepoys and a handful of artillerymen, giving the enemy no time to rally or to recover themselves. We were so handicapped, however, by our stiff European uniforms and by our want of practice in climbing, that we should have been unable to overtake any of the mountaineers had it not been for a fortunate accident.
There is a smaller ravine which opens into the main pass, and in their hurry and confusion some of the fugitives rushed down this. I saw sixty or seventy of them turn down, but I should have passed them by and continued in pursuit of the main body had not one of my scouts come rustling up to inform me that the smaller ravine was a cul-de-sac , and that the Afridis who had gone up it had no possible means of getting out again except by cutting their way through our ranks.
Here was an opportunity of striking terror into the tribes. Leaving Chamberlain and Elliott to continue the pursuit of the main body, I wheeled my Sepoys into the narrow path and proceeded slowly down it in extended order, covering the whole ground from cliff to cliff. Not a jackal could have passed us unseen. The rebels were caught like rats in a trap.
The defile in which we found ourselves was the most gloomy and majestic that I have ever seen. On either side naked precipices rose sheer up for a thousand feet or more, converging upon each other so as to leave a very narrow slit of daylight above us, which was further reduced by the feathery fringe of palm trees and aloes which hung over each lip of the chasm.
The cliffs were not more than a couple of hundred yards apart at the entrance, but as we advanced they grew nearer and nearer, until a half company in close order could hardly march abreast.
A sort of twilight reigned in this strange valley, and the dim, uncertain light made the great, basalt rocks loom up vague and fantastic. There was no path, and the ground was most uneven, but I pushed on briskly, cautioning my fellows to have their fingers on their triggers, for I could see that we were nearing the point where the two cliffs would form an acute angle with each other.
At last we came in sight of the place. A great pile of boulders was heaped up at the very end of the pass, and among these our fugitives were skulking, entirely demoralized apparently, and incapable of resistance. They were useless as prisoners, and it was out of the question to let them go, so there was no choice but to polish them off.
Waving my sword, I was leading my men on, when we had a most dramatic interruption of a sort which I have seen once or twice on the boards of Drury Lane, but never in real life.
In the side of the cliff, close to the pile of stones where the Hillmen were making their last stand, there was a cave which looked more like the lair of some wild beast than a human habitation.
Out of this dark archway there suddenly emerged an old man—such a very, very old man that all the other veterans whom I have seen were as chickens compared with him. His hair and beard were both as white as snow, and each reached more than half-way to his waist. His face was wrinkled and brown and ebony, a cross between a monkey and a mummy, and so thin and emaciated were his shriveled limbs that you would hardly have given him credit for having any vitality left, were it not for his eyes, which glittered and sparkled with excitement, like two diamonds in a setting of mahogany.
This apparition came rushing out of the cave, and, throwing himself between the fugitives and our fellows, motioned us back with as imperious a sweep of the hand as ever an emperor used to his slaves.
“Men of blood,” he cried, in a voice of thunder, speaking excellent English, too—“this is a place for prayer and meditation, not for murder. Desist, lest the wrath of the gods fall upon you.”
“Stand aside, old man,” I shouted.
I could see that the Hillmen were taking heart, and that some of my Sepoys were flinching, as if they did not relish this new enemy. Clearly, I must act promptly if I wished to complete our success.
portrait of Sir Arthur Conan Doyle
I dashed forward at the head of the white artillerymen who had stuck to me. The old fellow rushed at us with his arms out as if to stop us, but it was not time to stick at trifles, so I passed my sword through his body at the same moment that one of the gunners brought his carbine down upon his head. He dropped instantly, and the Hillmen, at the sight of his fall, set up the most unearthly howl of horror and consternation.
The Sepoys, who had been inclined to hang back, came on again the moment he was disposed of, and it did not take us long to consummate our victory. Hardly a man of the enemy got out of the defile alive.
What could Hannibal or Caesar have done more? Our own loss in the whole affair has been insignificant—three killed and about fifteen wounded. Got their banner, a green wisp of a thing with a sentence of the Koran engraved upon it.
I looked, after the action, for the old chap, but his body had disappeared, though how or whither I have no conception.  He would be alive now if he had not interfered, as the constables say at home, “with an officer in the execution of his duty.”
The scouts tell me that his name was Ghoolab Shah, and that he was one of the highest and holiest of the Buddhists. He had great fame in the district as a prophet and worker of miracles—hence the hubbub when he was cut down. They tell me that he was living in this very cave when Tamerlane passed this way in 1399, with a lot more bosh of that sort.
I went into the cave, and how any man could live in it a week is a mystery to me, for it was little more than four feet high, and as damp and dismal a grotto as ever was seen. A wooden settle and a rough table were the sole furniture, with a lot of parchment scrolls with hieroglyphics.
Well, he has gone where he will learn that the gospel of peace and good will is superior to all his Pagan lore. Peace go with him.
Elliott and Chamberlain never caught the main body—I knew they wouldn’t—so the honours of the day rest with me. I ought to get a step for it, anyhow, and perhaps, who knows? some mention in the Gazette. What a lucky chance! I think Zemaun deserves his telescope after all for giving it to me. Shall have something to eat now, for I am half starved. Glory is an excellent thing, but you cannot live upon it.
October 6, 11 A.M.—Let me try to set down as calmly and as accurately as I can all that occurred last night. I have never been a dreamer or a visionary, so I can rely upon my own senses, though I am bound to say that if any other fellow had told me the same thing I should have doubted him. I might even have suspected that I was deceived at the time had I not heard the bell since. However, I must narrate what happened.
Elliott was in my tent with me having a quiet cheroot until about ten o’clock. I then walked the rounds with my jemidar, and having seen that all was right I turned in a little before eleven.
I was just dropping off to sleep, for I was dog-tired after the day’s work, when I was aroused by some slight noise, and, looking round, I saw a man dressed in Asiatic costume standing at the entrance of my tent. He was motionless when I saw him, and he had his eyes fixed upon me with a solemn and stern expression.
My first thought was that the fellow was some Ghazi or Afghan fanatic who had stolen in with the intention of stabbing me, and with this idea in my mind I had all the will to spring from my couch and defend myself, but the power was unaccountably lacking.
An overpowering languor and want of energy possessed me. Had I seen the dagger descending upon my breast I could not have made an effort to avert it. I suppose a bird when it is under the influence of a snake feels very much as I did in the presence of this gloomy-faced stranger. My mind was clear enough, but my body was as torpid as though I were still asleep.
I shut my eves once or twice and tried to persuade myself that the whole thing was a delusion, but every time that I opened them there was the man still regarding me with the same stony, menacing stare.
The silence became unendurable. I felt that I must overcome my languor so far as to address him. I am not a nervous man, and I never knew before what Virgil meant when he wrote “adhoesit faucibus ora.” At last I managed to stammer out a few words, asking the intruder who he was and what he wanted.
“Lieutenant Heatherstone,” he answered, speaking slowly and gravely, “you have committed this day the foulest sacrilege and the greatest crime which it is possible for man to do. You have slain one of the thrice blessed and reverend ones, an arch adept of the first degree, an elder brother who has trod the higher path for more years than you have numbered months. You have cut him off at a time when his labours promised to reach a climax and when he was about to attain a height of occult knowledge which would have brought man one step nearer to his Creator. All this you have done without excuse, without provocation, at a time when he was pleading the cause of the helpless and distressed. Listen now to me, John Heatherstone.
“When first the occult sciences were pursued many thousands of years ago, it was found by the learned that the short tenure of human existence was too limited to allow a man to attain the loftiest heights of inner life. The inquirers of those days directed their energies in the first place, therefore, to the lengthening of their own days in order that they might have more scope for improvement.
“By their knowledge of the secret laws of Nature they were enabled to fortify their bodies against disease and old age. It only remained to protect themselves against the assaults of wicked and violent men who are ever ready to destroy what is wiser and nobler than themselves. There was no direct means by which this protection could be effected, but it was in some measure attained by arranging the occult forces in such a way that a terrible and unavoidable retribution should await the offender.
“It was irrevocably ordained by laws which cannot be reversed that any one who should shed the blood of a brother who had attained a certain degree of sanctity should be a doomed man. Those laws are extant to this day, John Heatherstone, and you have placed yourself in their power. King or emperor would be helpless before the forces which you have called into play. What hope, then, is there for you?
“In former days these laws acted so instantaneously that the slayer perished with his victim. It was judged afterwards that this prompt retribution prevented the offender from having time to realize the enormity of his offence.
“It was therefore ordained that in all such cases the retribution should be left in the hands of the chelas , or immediate disciples of the holy man, with power to extend or shorten it at their will, exacting it either at the time or at any future anniversary of the day when the crime was committed.
“Why punishment should come on those days only it does not concern you to know. Suffice it that you are the murderer of Ghoolab Shah, the thrice blessed, and that I am the senior of his three chelas commissioned to avenge his death.
“It is no personal matter between us. Amid our studies we have no leisure or inclination for personal matters. It is an immutable law, and it is as impossible for us to relax it as it is for you to escape from it Sooner or later we shall come to you and claim your life in atonement for the one which you have taken.
“The same fate shall be meted out to the wretched soldier, Smith, who, though less guilty than yourself, has incurred the same penalty by raising his sacrilegious hand against the chosen of Buddha. If your life is prolonged, it is merely that you may have time to repent of your misdeed and to feel the full force of your punishment.
“And lest you should be tempted to cast it out of your mind and to forget it, our bell—our astral bell, the use of which is one of our occult secrets—shall ever remind you of what have been and what is to be. You shall hear it by day and you shall hear it by night, and it will be a sign to you that do what you may and go where you will, you can never shake yourself clear of the chelas of Ghoolab Shah.
“You will never see me more, accursed one, until the day when we come for you. Live in fear, and in that anticipation which is worse than death.”
With a menacing wave of the hand the figure turned and swept out of my tent into the darkness. The instant that the fellow disappeared from my sight I recovered from my lethargy which had fallen upon me. Springing to my feet, I rushed to the opening and looked out.
“You dog,” I said in Hindustani. “What do you mean by letting people disturb me in this way?”
The man stared at me in amazement. “Has any one disturbed the sahib?” he asked.
“This instant—this moment. You must have seen him pass out of my tent.”
“Surely the Burra Sahib is mistaken,” the man answered, respectfully but firmly. “I have been here for an hour, and no one has passed from the tent.”
Puzzled and disconcerted, I was sitting by the side of my couch wondering whether the whole thing were a delusion, brought on by the nervous excitement of our skirmish, when a new marvel overtook me. From over my head there suddenly sounded a sharp, tinkling sound, like that produced by an empty glass when flipped by the nail, only louder and more intense.
I looked up, but nothing was to be seen. I examined the whole interior of the tent carefully, but without discovering any cause for the strange sound. At last, worn out with fatigue, I gave the mystery up, and throwing myself on the couch was soon fast asleep.
When I awoke this morning I was inclined to put the whole of my yesternight’s experiences down to imagination, but I was soon disabused of the idea, for I had hardly risen before the same strange sound was repeated in my very ear as loudly, and to all appearance as causelessly, as before. What it is or where it comes from I cannot conceive. I have not heard it since.
Can the fellow’s threats have something in them and this be the warning bell of which he spoke? Surely it is impossible. Yet his manner was indescribably impressive.
I have tried to set down what he said as accurately as I can, but I fear I have omitted a good deal. What is to be the end of this strange affair? I must go in for a course of religion and holy water. Not a word to Chamberlain or Elliott. They tell me I am looking like a ghost this morning.
Evening .—Have managed to compare notes with Gunner Rufus Smith of the Artillery, who knocked the old fellow over with the butt of his gun. His experience has been the same as mine. He has heard the sound, too. What is the meaning of it all? My brain is in a whirl.
Oct. 10 (four days later).—God help us!
This last laconic entry terminated the journal. It seemed to me that, coming as it did after four days’ complete silence, it told a clearer tale of shaken nerve and a broken spirit than could any more elaborate narrative. Pinned on to the journal was a supplementary statement which had evidently been recently added by the general.
“From that day to this,” it said, “I have had no night or day free from the intrusion of that dreadful sound with its accompanying train of thought. Time and custom have brought me no relief, but on the contrary, as the years pass over my head my physical strength decreases and my nerves become less able to bear up against the continual strain.
“I am a broken man in mind and body. I live in a state of tension, always straining my ears for the hated sound, afraid to converse with my fellows for fear of exposing my dreadful condition to them, with no comfort or hope of comfort on this side of the grave. I should be willing. Heaven knows, to die, and yet as each 5th of October comes round, I am prostrated with fear because I do not know what strange and terrible experience may be in store for me.
“Forty years have passed since I slew Ghoolab Shah, and forty times I have gone through all the horrors of death, without attaining the blessed peace which lies beyond.
“I have no means of knowing in what shape my fate will come upon me. I have immured myself in this lonely country, and surrounded myself with barriers, because in my weaker moments my instincts urge me to take some steps for self-protection, but I know well in my heart how futile it all is. They must come quickly now, for I grow old, and Nature will forestall them unless they make haste.
“I take credit to myself that I have kept my hands off the prussic-acid or opium bottle. It has always been in my power to checkmate my occult persecutors in that way, but I have ever held that a man in this world cannot desert his post until he has been relieved in due course by the authorities. I have had no scruples, however, about exposing myself to danger, and, during the Sikh and Sepoy wars, I did all that a man could do to court Death. He passed me by, however, and picked out many a young fellow to whom life was only opening and who had everything to live for, while I survived to win crosses and honours which had lost all relish for me.
“Well, well, these things cannot depend upon chance, and there is no doubt some deep reason for it all.
“One compensation Providence has made me in the shape of a true and faithful wife, to whom I told my dreadful secret before the wedding, and who nobly consented to share my lot. She has lifted half the burden from my shoulders, but with the effect, poor soul, of crushing her own life beneath its weight!
“My children, too, have been a comfort to me. Mordaunt knows all, or nearly all. Gabriel we have endeavoured to keep in the dark, though we cannot prevent her from knowing that there is something amiss.
“I should like this statement to be shown to Dr. John Easterling, of Stranraer. He heard on one occasion this haunting sound. My sad experience may show him that I spoke truth when I said that there was much knowledge in the world which has never found its way to England.
“J. B. HEATHERSTONE.”
It was going on for dawn by the time that I had finished this extraordinary narrative, to which my sister and Mordaunt Heatherstone listened with the most absorbed attention. Already we could see through the window that the stars had begun to fade and a grey light to appear in the east. The crofter who owned the lurcher dog lived a couple of miles off, so it was time for us to be on foot. Leaving Esther to tell my father the story in such fashion as she might, we thrust some food in our pockets and set off upon our solemn and eventful errand.