本文整理汇总了TypeScript中@jupyterlab/apputils.ClientSession.shutdown方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ClientSession.shutdown方法的具体用法?TypeScript ClientSession.shutdown怎么用?TypeScript ClientSession.shutdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@jupyterlab/apputils.ClientSession
的用法示例。
在下文中一共展示了ClientSession.shutdown方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should handle a starting session', async () => {
await session.shutdown();
session = await createClientSession();
const item = Toolbar.createKernelStatusItem(session);
expect(item.node.title).to.equal('Kernel Starting');
expect(item.hasClass('jp-FilledCircleIcon')).to.equal(true);
}).timeout(20000); // Allow for slower CI
示例2: it
it('should be emitted when the session is terminated', async () => {
await session.initialize();
session.terminated.connect((sender, args) => {
expect(sender).to.equal(session);
expect(args).to.be.undefined;
});
await session.shutdown();
});
示例3: expect
session.initialize().then(() => {
session.terminated.connect((sender, args) => {
expect(sender).to.be(session);
expect(args).to.be(undefined);
done();
});
return session.shutdown();
}).catch(done);
示例4: afterEach
afterEach(async () => {
Dialog.flush();
try {
await session.shutdown();
} catch (error) {
console.warn('Session shutdown failed.', error);
}
session.dispose();
});
示例5: it
it('should connect to an existing kernel', async () => {
// Shut down and dispose the session so it can be re-instantiated.
await session.shutdown();
session.dispose();
const other = await manager.startNew({ path: UUID.uuid4() });
const kernelPreference = { id: other.kernel.id };
session = new ClientSession({ manager, kernelPreference });
await session.initialize();
expect(session.kernel.id).to.equal(other.kernel.id);
// We don't call other.shutdown() here because that
// is handled by the afterEach() handler above.
other.dispose();
});
示例6: afterEach
afterEach(async () => {
await session.shutdown();
session.dispose();
});
示例7: after
after(() => {
return Promise.all([session.shutdown(), ipySession.shutdown()]);
});
示例8:
return session.initialize().then(() => {
return session.shutdown();
}).then(() => {