ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ilya Kasnacheev <ilya.kasnach...@gmail.com>
Subject Re: Thin Client lib: Python
Date Thu, 26 Jul 2018 12:44:45 GMT
Hello!

Why not use cache name as string here, instead of cache_id()?

cache_put(conn, 'my-cache', value=1, key='a')

Regards,

-- 
Ilya Kasnacheev

2018-07-26 5:11 GMT+03:00 Dmitry Melnichuk <dmitry.melnichuk@nobitlost.com>:

> Either
>
> ```
> conn = Connection('example.com', 10800)
> cache_put(conn, cache_id('my-cache'), 'a', 1)
> ```
>
> or
>
> ```
> conn = Connection('example.com', 10800)
> my_cache_id = cache_id('my-cache')
> cache_put(conn, my_cache_id, 'a', 1)
> ```
>
> It is also possible to give parameters names, if you like to.
>
> ```
> conn = Connection('example.com', 10800)
> cache_put(conn, cache_id('my-cache'), key='a', value=1)
> ```
>
> This should also work, but not recommended:
>
> ```
> conn = Connection('example.com', 10800)
> cache_put(conn, cache_id('my-cache'), value=1, key='a')
> ```
>
> All variants can coexist in one user program.
>
>
> On 07/26/2018 05:46 AM, Dmitriy Setrakyan wrote:
>
>> I am still confused. Let's work through an example. Suppose I have a cache
>> named "my_cache" and I want to put an entry with key "a" and value "1".
>>
>> In Java, this code will look like this:
>>
>>
>> *IgniteCache<...> myCache = ignite.cache("my-cache");myCache.put("a",
>>> 1);*
>>>
>>
>>
>> How will the same code look in Python?
>>
>> D.
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message